闭社主体 forked from https://github.com/tootsuite/mastodon
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.3 KiB

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