diff options
author | Jesús <heckyel@hyperbola.info> | 2021-06-23 15:19:31 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-06-23 15:19:31 -0500 |
commit | 61b45183352754a9174a75f0ee8600ffb261bb97 (patch) | |
tree | f2ded231d1f780d7fc5faf069a9e953ead50cb08 /youtube | |
parent | ec031a9b01be8c3fac7bcabfb171f4abb3b53c71 (diff) | |
download | yt-local-61b45183352754a9174a75f0ee8600ffb261bb97.tar.lz yt-local-61b45183352754a9174a75f0ee8600ffb261bb97.tar.xz yt-local-61b45183352754a9174a75f0ee8600ffb261bb97.zip |
Fix set language subtitles
Diffstat (limited to 'youtube')
-rw-r--r-- | youtube/static/js/plyr-start.js | 23 | ||||
-rw-r--r-- | youtube/templates/watch.html | 26 |
2 files changed, 25 insertions, 24 deletions
diff --git a/youtube/static/js/plyr-start.js b/youtube/static/js/plyr-start.js deleted file mode 100644 index aae3002..0000000 --- a/youtube/static/js/plyr-start.js +++ /dev/null @@ -1,23 +0,0 @@ -// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later -const player = new Plyr(document.getElementById('js-video-player'), { - disableContextMenu: false, - captions: { - active: true, - language: 'en' - }, - controls: [ - 'play-large', - 'play', - 'progress', - 'current-time', - 'mute', - 'volume', - 'captions', - 'settings', - 'fullscreen' - ], - iconUrl: "/youtube.com/static/modules/plyr/plyr.svg", - blankVideo: "/youtube.com/static/modules/plyr/blank.webm", - debug: false -}); -// @license-end diff --git a/youtube/templates/watch.html b/youtube/templates/watch.html index 798e783..8a2949e 100644 --- a/youtube/templates/watch.html +++ b/youtube/templates/watch.html @@ -385,7 +385,31 @@ <script src="/youtube.com/static/modules/plyr/plyr.min.js" integrity="sha512-l6ZzdXpfMHRfifqaR79wbYCEWjLDMI9DnROvb+oLkKq6d7MGroGpMbI7HFpicvmAH/2aQO+vJhewq8rhysrImw==" crossorigin="anonymous"></script> - <script src="/youtube.com/static/js/plyr-start.js"></script> + <script> + // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later + const player = new Plyr(document.getElementById('js-video-player'), { + disableContextMenu: false, + captions: { + active: true, + language: '{{ settings.subtitles_language }}' + }, + controls: [ + 'play-large', + 'play', + 'progress', + 'current-time', + 'mute', + 'volume', + 'captions', + 'settings', + 'fullscreen' + ], + iconUrl: "/youtube.com/static/modules/plyr/plyr.svg", + blankVideo: "/youtube.com/static/modules/plyr/blank.webm", + debug: false + }); + // @license-end + </script> <!-- /plyr --> {% elif settings.use_video_player == 1 %} <script src="/youtube.com/static/js/hotkeys.js"></script> |