add syuff

This commit is contained in:
ashley 2024-09-24 18:33:10 +00:00
parent 4c2001ceee
commit 5bf3da0dc0

View file

@ -3,7 +3,6 @@ document.addEventListener("DOMContentLoaded", () => {
controls: true, controls: true,
autoplay: false, autoplay: false,
preload: 'auto', preload: 'auto',
}); });
const qua = new URLSearchParams(window.location.search).get("quality") || ""; const qua = new URLSearchParams(window.location.search).get("quality") || "";
@ -64,6 +63,7 @@ document.addEventListener("DOMContentLoaded", () => {
audio.play(); audio.play();
} else { } else {
video.pause(); video.pause();
audio.pause();
} }
}); });
@ -71,7 +71,17 @@ document.addEventListener("DOMContentLoaded", () => {
audio.pause(); audio.pause();
}); });
video.on('waiting', () => {
video.pause();
audio.pause();
});
video.on('canplaythrough', () => {
if (!video.paused()) {
video.play();
audio.play();
}
});
video.on('seeking', handleSeek); video.on('seeking', handleSeek);