diff options
author | ThibG <thib@sitedethib.com> | 2020-04-25 12:16:05 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2020-04-25 15:28:16 +0200 |
commit | 572e89e56323e2f398ea5a168caf3d8b7e3e46b8 (patch) | |
tree | f28e5715912d2d7b318b61240fde3d07759210a1 /app/javascript/flavours/glitch/features/ui | |
parent | 0f4a8a64877dfd2953e515043cefa87c1f031d14 (diff) |
[Glitch] Fix expanded video player issues
Port c955f98d36868e85b0f1939a3a1c58c00babd4e8 to glitch-soc Signed-off-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/features/ui')
-rw-r--r-- | app/javascript/flavours/glitch/features/ui/components/video_modal.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/app/javascript/flavours/glitch/features/ui/components/video_modal.js b/app/javascript/flavours/glitch/features/ui/components/video_modal.js index e7309021e..afeff90a4 100644 --- a/app/javascript/flavours/glitch/features/ui/components/video_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/video_modal.js @@ -16,7 +16,11 @@ export default class VideoModal extends ImmutablePureComponent { static propTypes = { media: ImmutablePropTypes.map.isRequired, status: ImmutablePropTypes.map, - time: PropTypes.number, + options: PropTypes.shape({ + startTime: PropTypes.number, + autoPlay: PropTypes.bool, + defaultVolume: PropTypes.number, + }), onClose: PropTypes.func.isRequired, }; @@ -28,7 +32,8 @@ export default class VideoModal extends ImmutablePureComponent { } render () { - const { media, status, time, onClose } = this.props; + const { media, status, onClose } = this.props; + const options = this.props.options || {}; return ( <div className='modal-root__modal video-modal'> @@ -37,7 +42,9 @@ export default class VideoModal extends ImmutablePureComponent { preview={media.get('preview_url')} blurhash={media.get('blurhash')} src={media.get('url')} - startTime={time} + startTime={options.startTime} + autoPlay={options.autoPlay} + defaultVolume={options.defaultVolume} onCloseVideo={onClose} detailed alt={media.get('description')} |