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