From 47833803b20982d93e7260a98a597cc63e73e271 Mon Sep 17 00:00:00 2001 From: ashley Date: Sun, 7 Jul 2024 19:58:53 +0000 Subject: [PATCH] fix seekbar on fulscreen --- html/poketube.ejs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/html/poketube.ejs b/html/poketube.ejs index 58303db7..f305074c 100644 --- a/html/poketube.ejs +++ b/html/poketube.ejs @@ -755,6 +755,17 @@ background-color: #0000; const timestamps = document.getElementById("timestamps"); timestamps.innerText = `${csts(video.currentTime)}/${csts(video.duration)}`; }); + setTimeout(()=>{ + video.addEventListener("seeking", (event) => { + if(!didFirstTimePlay) return; + if(qua != "medium") { + video.pause() + canPlayPause = false; + aud.pause() + aud.currentTime = event.target.currentTime + } + }); + }, 200) seekbar.addEventListener("input", (event) => { video.pause() canPlayPause = false; @@ -788,6 +799,8 @@ background-color: #0000; playPauseButton.addEventListener("click", () => { toggleVideo() }); + video.addEventListener("pause", ()=>{if(qua != "medium") {aud.pause()}}); + video.addEventListener("play", ()=>{if(qua != "medium") {aud.play()}}) video.addEventListener("click", toggleVideo); video.addEventListener("dblclick", () => { document.documentElement.requestFullscreen();