add media control stuff :3

This commit is contained in:
ashley 2024-08-05 17:43:18 +00:00
parent 84057e8649
commit 92fd9c8f0f

View file

@ -692,7 +692,17 @@ background-color: #0000;
video.on('volumechange', syncVolume);
audio.addEventListener('volumechange', syncVolumeWithVideo);
// Listen for media control events
document.addEventListener('play', () => {
video.play();
audio.play();
});
document.addEventListener('pause', () => {
video.pause();
audio.pause();
});
document.addEventListener('fullscreenchange', () => {
if (!document.fullscreenElement) {
video.pause();