mirror of
https://github.com/onsonr/sonr.git
synced 2025-03-10 21:09:11 +00:00
feat: Refactor intro video component to use a proper script template
This commit is contained in:
parent
bda52d5f3d
commit
7b5ee7b0ed
@ -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"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user