From 5bf3da0dc035283de2cb1b293df0bc72df6a56f7 Mon Sep 17 00:00:00 2001 From: ashley Date: Tue, 24 Sep 2024 18:33:10 +0000 Subject: [PATCH] add syuff --- css/player-base.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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);