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