VideoOverlay: add controls option (#9666)

This commit is contained in:
Simon Legner
2025-04-21 07:57:28 +02:00
committed by GitHub
parent 2d78fab823
commit 90095bc810
2 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,7 @@
opacity: 0.8,
interactive: true,
autoplay: true,
controls: true,
loop: true,
muted: true,
playsInline: true

View File

@ -31,6 +31,10 @@ export const VideoOverlay = ImageOverlay.extend({
// On some browsers autoplay will only work with `muted: true`
autoplay: true,
// @option loop: Boolean = false
// Whether the browser will offer controls to allow the user to control video playback, including volume, seeking, and pause/resume playback.
controls: false,
// @option loop: Boolean = true
// Whether the video will loop back to the beginning when played.
loop: true,
@ -76,6 +80,7 @@ export const VideoOverlay = ImageOverlay.extend({
vid.style['objectFit'] = 'fill';
}
vid.autoplay = !!this.options.autoplay;
vid.controls = !!this.options.controls;
vid.loop = !!this.options.loop;
vid.muted = !!this.options.muted;
vid.playsInline = !!this.options.playsInline;