From 96c61f26d0948927b9326381ecd76d184640b190 Mon Sep 17 00:00:00 2001 From: ashley Date: Sun, 7 Jul 2024 20:49:24 +0000 Subject: [PATCH] fix stuff --- html/poketube.ejs | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/html/poketube.ejs b/html/poketube.ejs index f305074c..0d7d29c9 100644 --- a/html/poketube.ejs +++ b/html/poketube.ejs @@ -755,17 +755,7 @@ 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; @@ -774,6 +764,11 @@ background-color: #0000; aud.currentTime = event.target.value } video.currentTime = event.target.value + canPlayPause = true; + setTimeout(()=>{ + video.play(); + aud.play(); + }, 200) }); // Play/Pause @@ -890,7 +885,17 @@ background-color: #0000; seekbar.value = 0 setTime = true } - + setTimeout(()=>{ + video.addEventListener("seeking", (event) => { + if(!didFirstTimePlay) return; + if(qua != "medium") { + video.pause() + canPlayPause = false; + aud.pause() + aud.currentTime = event.target.currentTime + } + }); + }, 500) } const aud = document.getElementById("aud"); const vid = document.getElementById("video");