feat: Refactor intro video component to use a proper script template

This commit is contained in:
Prad Nukala 2024-10-23 12:51:49 -04:00
parent bda52d5f3d
commit 7b5ee7b0ed

View File

@ -116,32 +116,7 @@ seconds: result.substring(6, 8),
}; };
} }
}" }"
x-init=" x-data="introVideo"
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"