diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/javascript/flavours/glitch/features/video/index.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/features/video/index.js b/app/javascript/flavours/glitch/features/video/index.js index 4823ac274..a578df026 100644 --- a/app/javascript/flavours/glitch/features/video/index.js +++ b/app/javascript/flavours/glitch/features/video/index.js @@ -295,6 +295,15 @@ export default class Video extends React.PureComponent { warning = <FormattedMessage id='status.media_hidden' defaultMessage='Media hidden' />; } + let preload; + if (startTime || fullscreen || dragging) { + preload = 'auto'; + } else if (detailed) { + preload = 'metadata'; + } else { + preload = 'none'; + } + return ( <div className={classNames('video-player', { inactive: !revealed, detailed, inline: inline && !fullscreen, fullscreen, letterbox, 'full-width': fullwidth })} @@ -309,7 +318,7 @@ export default class Video extends React.PureComponent { ref={this.setVideoRef} src={src} poster={preview} - preload={startTime ? 'auto' : 'none'} + preload={preload} loop role='button' tabIndex='0' |