fix: update intro video modal script

This commit is contained in:
Prad Nukala 2024-10-23 12:51:48 -04:00 committed by Prad Nukala (aider)
parent 137f0ed7f3
commit bda52d5f3d

View File

@ -116,7 +116,32 @@ seconds: result.substring(6, 8),
}; };
} }
}" }"
x-init={ IntroVideoScript() } x-init="
supportsVideo = document.createElement('video').canPlayType;
if (!supportsVideo) {
alert('This browser does not support the video element');
}
$refs.player.load();
// Hide the default player controls
$refs.player.controls = false;
$watch('playing', (value) => {
if (value) {
ended = false;
controlsHideTimeout = setTimeout(() => {
controls = false;
}, autoHideControlsDelay);
} else {
clearTimeout(controlsHideTimeout);
controls = true;
}
});
if (!document?.fullscreenEnabled) {
$refs.fullscreenButton.style.display = 'none';
}
document.addEventListener('fullscreenchange', (e) => {
fullscreen = !!document.fullscreenElement;
});
"
x-ref="videoContainer" x-ref="videoContainer"
@mouseleave="mouseleave=true" @mouseleave="mouseleave=true"
@mousemove="mousemoveVideo" @mousemove="mousemoveVideo"