diff options
author | Astound <kirito@disroot.org> | 2024-01-22 07:44:24 +0800 |
---|---|---|
committer | Astound <kirito@disroot.org> | 2024-01-22 07:44:24 +0800 |
commit | 00bd9fee6f59900f80272babd610055d0d38fced (patch) | |
tree | 9d04125431d21a49abe19fbbbefcc39c8c3f1598 /youtube | |
parent | b215e2a3b235f167796355e10d48fa63fc61ce1f (diff) | |
download | yt-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.
Diffstat (limited to 'youtube')
-rw-r--r-- | youtube/static/js/plyr-start.js | 4 |
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, |