2017-05-03 10:04:16 +10:00
|
|
|
import React from 'react';
|
2017-04-13 23:04:18 +10:00
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
2017-04-22 04:05:35 +10:00
|
|
|
import PropTypes from 'prop-types';
|
2017-04-13 23:04:18 +10:00
|
|
|
import ExtendedVideoPlayer from '../../../components/extended_video_player';
|
|
|
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
|
|
import IconButton from '../../../components/icon_button';
|
2017-05-03 10:04:16 +10:00
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
2017-04-13 23:04:18 +10:00
|
|
|
|
|
|
|
const messages = defineMessages({
|
2017-05-21 01:31:47 +10:00
|
|
|
close: { id: 'lightbox.close', defaultMessage: 'Close' },
|
2017-04-13 23:04:18 +10:00
|
|
|
});
|
|
|
|
|
2017-06-24 03:36:54 +10:00
|
|
|
@injectIntl
|
|
|
|
export default class VideoModal extends ImmutablePureComponent {
|
2017-04-13 23:04:18 +10:00
|
|
|
|
2017-05-12 22:44:10 +10:00
|
|
|
static propTypes = {
|
|
|
|
media: ImmutablePropTypes.map.isRequired,
|
|
|
|
time: PropTypes.number,
|
|
|
|
onClose: PropTypes.func.isRequired,
|
2017-05-21 01:31:47 +10:00
|
|
|
intl: PropTypes.object.isRequired,
|
2017-05-12 22:44:10 +10:00
|
|
|
};
|
|
|
|
|
2017-04-13 23:04:18 +10:00
|
|
|
render () {
|
2017-04-14 01:01:09 +10:00
|
|
|
const { media, intl, time, onClose } = this.props;
|
2017-04-13 23:04:18 +10:00
|
|
|
|
|
|
|
const url = media.get('url');
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className='modal-root__modal media-modal'>
|
|
|
|
<div>
|
2017-04-23 12:26:55 +10:00
|
|
|
<div className='media-modal__close'><IconButton title={intl.formatMessage(messages.close)} icon='times' overlay onClick={onClose} /></div>
|
2017-06-06 21:20:07 +10:00
|
|
|
<ExtendedVideoPlayer src={url} muted={false} controls time={time} />
|
2017-04-13 23:04:18 +10:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-04-22 04:05:35 +10:00
|
|
|
}
|