The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

40 lines
1.2 KiB

  1. import React from 'react';
  2. import ImmutablePropTypes from 'react-immutable-proptypes';
  3. import PropTypes from 'prop-types';
  4. import ExtendedVideoPlayer from '../../../components/extended_video_player';
  5. import { defineMessages, injectIntl } from 'react-intl';
  6. import IconButton from '../../../components/icon_button';
  7. import ImmutablePureComponent from 'react-immutable-pure-component';
  8. const messages = defineMessages({
  9. close: { id: 'lightbox.close', defaultMessage: 'Close' },
  10. });
  11. class VideoModal extends ImmutablePureComponent {
  12. static propTypes = {
  13. media: ImmutablePropTypes.map.isRequired,
  14. time: PropTypes.number,
  15. onClose: PropTypes.func.isRequired,
  16. intl: PropTypes.object.isRequired,
  17. };
  18. render () {
  19. const { media, intl, time, onClose } = this.props;
  20. const url = media.get('url');
  21. return (
  22. <div className='modal-root__modal media-modal'>
  23. <div>
  24. <div className='media-modal__close'><IconButton title={intl.formatMessage(messages.close)} icon='times' overlay onClick={onClose} /></div>
  25. <ExtendedVideoPlayer src={url} muted={false} controls time={time} />
  26. </div>
  27. </div>
  28. );
  29. }
  30. }
  31. export default injectIntl(VideoModal);