aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAstound <kirito@disroot.org>2024-01-22 07:44:24 +0800
committerAstound <kirito@disroot.org>2024-01-22 07:44:24 +0800
commit00bd9fee6f59900f80272babd610055d0d38fced (patch)
tree9d04125431d21a49abe19fbbbefcc39c8c3f1598
parentb215e2a3b235f167796355e10d48fa63fc61ce1f (diff)
downloadyt-local-00bd9fee6f59900f80272babd610055d0d38fced.tar.lz
yt-local-00bd9fee6f59900f80272babd610055d0d38fced.tar.xz
yt-local-00bd9fee6f59900f80272babd610055d0d38fced.zip
Add autoplay functionality in Plyr video player
Introduce autoplay feature in the Plyr video player based on the configuration settings.
-rw-r--r--youtube/static/js/plyr-start.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/youtube/static/js/plyr-start.js b/youtube/static/js/plyr-start.js
index d3a6913..d9fde90 100644
--- a/youtube/static/js/plyr-start.js
+++ b/youtube/static/js/plyr-start.js
@@ -14,6 +14,9 @@
captionsActive = false;
}
+ // AutoPlay
+ let autoplayActive = data.settings.autoplay_videos === true ? true : false;
+
let qualityOptions = [];
let qualityDefault;
for (let src of data['uni_sources']) {
@@ -72,6 +75,7 @@
});
const player = new Plyr(document.getElementById('js-video-player'), {
+ autoplay: autoplayActive,
disableContextMenu: false,
captions: {
active: captionsActive,