From 00bd9fee6f59900f80272babd610055d0d38fced Mon Sep 17 00:00:00 2001 From: Astound Date: Mon, 22 Jan 2024 07:44:24 +0800 Subject: Add autoplay functionality in Plyr video player Introduce autoplay feature in the Plyr video player based on the configuration settings. --- youtube/static/js/plyr-start.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'youtube/static/js/plyr-start.js') 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, -- cgit v1.2.3