From b017d057e4d7da7947651d5d0d7a9664bd69846d Mon Sep 17 00:00:00 2001 From: Ashley Date: Fri, 10 Feb 2023 16:13:02 +0000 Subject: [PATCH] fix some stuff :3 --- html/poketube.ejs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/html/poketube.ejs b/html/poketube.ejs index 5442d29..131a6f9 100644 --- a/html/poketube.ejs +++ b/html/poketube.ejs @@ -288,7 +288,7 @@ @@ -1158,10 +1158,27 @@ checkbox.addEventListener('change', function(e) { document.getElementById('video').addEventListener('ended',autoplaynextvideo,false); function autoplaynextvideo(e) { - location.href = "/watch?v=<%- k.Video.Recommendations.Video[0].id%>" + location.href = "/watch?v=<%- k.Video.Recommendations.Video[0].id%>&autoplay=<%-btoa("1f739d935676111cfff4b4693e3816e664797050" + k.Video.Recommendations.Video[0].id ) %>" } } + if (/[?&]autoplay=/.test(location.search)) { + if(!chebox.check) { + checkbox.checked = true; + } + } }); + +if (/[?&]autoplay=/.test(location.search)) { + checkbox.checked = true; + + console.log("[AUTOPLAY BETA] enabled") + + document.getElementById('video').addEventListener('ended',autoplaynextvideo,false); + + function autoplaynextvideo(e) { + location.href = "/watch?v=<%- k.Video.Recommendations.Video[0].id%>&autoplay=<%-btoa("1f739d935676111cfff4b4693e3816e664797050" + k.Video.Recommendations.Video[0].id ) %>" + } +} <% if (!optout) { %>