diff --git a/css/player-base.js b/css/player-base.js index cf3be0b0..0b6a875d 100644 --- a/css/player-base.js +++ b/css/player-base.js @@ -3,7 +3,6 @@ document.addEventListener("DOMContentLoaded", () => { controls: true, autoplay: false, preload: 'auto', - }); const qua = new URLSearchParams(window.location.search).get("quality") || ""; @@ -64,6 +63,7 @@ document.addEventListener("DOMContentLoaded", () => { audio.play(); } else { video.pause(); + audio.pause(); } }); @@ -71,7 +71,17 @@ document.addEventListener("DOMContentLoaded", () => { audio.pause(); }); + video.on('waiting', () => { + video.pause(); + audio.pause(); + }); + video.on('canplaythrough', () => { + if (!video.paused()) { + video.play(); + audio.play(); + } + }); video.on('seeking', handleSeek);