diff options
author | Jesús <heckyel@hyperbola.info> | 2021-08-09 22:09:04 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-08-09 22:09:04 -0500 |
commit | af1df3116180aa85c7d0c5c4d5aa93af8f18e7ea (patch) | |
tree | 002f9322cd5a6231f4fff794a6d30314fb2f7fda /youtube/static/js | |
parent | 0e9c12b3a672531ca44f8436026fb16808978f53 (diff) | |
download | yt-local-af1df3116180aa85c7d0c5c4d5aa93af8f18e7ea.tar.lz yt-local-af1df3116180aa85c7d0c5c4d5aa93af8f18e7ea.tar.xz yt-local-af1df3116180aa85c7d0c5c4d5aa93af8f18e7ea.zip |
[plyr]: update
Diffstat (limited to 'youtube/static/js')
-rw-r--r-- | youtube/static/js/plyr-start.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/youtube/static/js/plyr-start.js b/youtube/static/js/plyr-start.js new file mode 100644 index 0000000..aff925f --- /dev/null +++ b/youtube/static/js/plyr-start.js @@ -0,0 +1,37 @@ +let captionsActive; + +switch(true) { + +case data.settings.subtitles_mode == 2: + captionsActive = true; + break; +case data.settings.subtitles_mode == 1 && data.has_manual_captions: + captionsActive = true; + break; +default: + captionsActive = false; +} + +const player = new Plyr(document.getElementById('js-video-player'), { + disableContextMenu: false, + captions: { + active: captionsActive, + language: data.settings.subtitles_language, + }, + controls: [ + 'play-large', + 'play', + 'progress', + 'current-time', + 'duration', + 'mute', + 'volume', + 'captions', + 'settings', + 'fullscreen' + ], + iconUrl: "/youtube.com/static/modules/plyr/plyr.svg", + blankVideo: "/youtube.com/static/modules/plyr/blank.webm", + debug: false, + storage: {enabled: false} +}); |