diff options
author | Jesús <heckyel@hyperbola.info> | 2021-07-03 23:38:50 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-07-03 23:38:50 -0500 |
commit | de5510d3e36759fd70e07448c4bff0b301caa97c (patch) | |
tree | 575e6b051191008979ce5751ac75efb0a68c574c /youtube/templates | |
parent | 20db70b9b9b95e149d2e13963a692f7eca6d8cc8 (diff) | |
download | yt-local-de5510d3e36759fd70e07448c4bff0b301caa97c.tar.lz yt-local-de5510d3e36759fd70e07448c4bff0b301caa97c.tar.xz yt-local-de5510d3e36759fd70e07448c4bff0b301caa97c.zip |
Improved plyr configuration
Diffstat (limited to 'youtube/templates')
-rw-r--r-- | youtube/templates/watch.html | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/youtube/templates/watch.html b/youtube/templates/watch.html index 9a80c68..f05fc81 100644 --- a/youtube/templates/watch.html +++ b/youtube/templates/watch.html @@ -404,15 +404,22 @@ crossorigin="anonymous"></script> <script> // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + 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: { - {% if settings.subtitles_mode > 0 %} - active: true, - {% else %} - active: false, - {% endif %} - language: '{{ settings.subtitles_language }}' + active: captionsActive, + language: data.settings.subtitles_language, }, controls: [ 'play-large', @@ -427,7 +434,8 @@ ], iconUrl: "/youtube.com/static/modules/plyr/plyr.svg", blankVideo: "/youtube.com/static/modules/plyr/blank.webm", - debug: false + debug: false, + storage: {enabled: false}, }); // @license-end </script> |