From b6a928cd04d5563ee08012b09d9e1c9f9efc9f07 Mon Sep 17 00:00:00 2001 From: Akira Ouchi Date: Mon, 9 Jan 2023 11:52:37 +0900 Subject: [Glitch] Add variable autoFocus to video Port 2195f21524270e50c00a6292f77dfe39342ff482 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/features/ui/components/video_modal.js | 1 + app/javascript/flavours/glitch/features/video/index.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'app/javascript') 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 6b6e615a6..90be11e4b 100644 --- a/app/javascript/flavours/glitch/features/ui/components/video_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/video_modal.js @@ -50,6 +50,7 @@ export default class VideoModal extends ImmutablePureComponent { autoPlay={options.autoPlay} volume={options.defaultVolume} onCloseVideo={onClose} + autoFocus detailed alt={media.get('description')} /> diff --git a/app/javascript/flavours/glitch/features/video/index.js b/app/javascript/flavours/glitch/features/video/index.js index cb4655f7f..0daab747b 100644 --- a/app/javascript/flavours/glitch/features/video/index.js +++ b/app/javascript/flavours/glitch/features/video/index.js @@ -124,6 +124,7 @@ class Video extends React.PureComponent { volume: PropTypes.number, muted: PropTypes.bool, componentIndex: PropTypes.number, + autoFocus: PropTypes.bool, }; static defaultProps = { @@ -537,7 +538,7 @@ class Video extends React.PureComponent { } render () { - const { preview, src, inline, onOpenVideo, onCloseVideo, intl, alt, letterbox, fullwidth, detailed, sensitive, editable, blurhash } = this.props; + const { preview, src, inline, onOpenVideo, onCloseVideo, intl, alt, letterbox, fullwidth, detailed, sensitive, editable, blurhash, autoFocus } = this.props; const { containerWidth, currentTime, duration, volume, buffer, dragging, paused, fullscreen, hovered, muted, revealed } = this.state; const progress = Math.min((currentTime / duration) * 100, 100); const playerStyle = {}; @@ -635,7 +636,7 @@ class Video extends React.PureComponent {
- +
-- cgit