From c0cadded4c17462d7ae17795a1ca2c3d336fb1ea Mon Sep 17 00:00:00 2001 From: Ashley Date: Fri, 8 Dec 2023 20:10:54 +0000 Subject: [PATCH] test ignore --- html/poketube.ejs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/html/poketube.ejs b/html/poketube.ejs index e03e96fa..03f4bbb3 100644 --- a/html/poketube.ejs +++ b/html/poketube.ejs @@ -1793,10 +1793,8 @@ const ctx = canvas.getContext("2d") let step; const draw = () => { - if (AMvideo.readyState >= 2) { // Check if video is playable (HAVE_CURRENT_DATA or greater) - ctx.drawImage(AMvideo, 0, 0, canvas.width, canvas.height); - } -}; + ctx.drawImage(AMvideo, 0, 0, canvas.width, canvas.height); + }; const drawLoop = () => { draw() @@ -1809,13 +1807,11 @@ const drawPause = () => { } const init = () => { - document.addEventListener("DOMContentLoaded", () => { - AMvideo.addEventListener("canplaythrough", draw, false); + AMvideo.addEventListener("canplaythrough", draw, false); AMvideo.addEventListener("play", drawLoop, false); AMvideo.addEventListener("pause", drawPause, false); AMvideo.addEventListener("ended", drawPause, false); - }); -}; + }; const cleanup = () => { AMvideo.removeEventListener("loadeddata", draw)