diff options
author | Jesús <heckyel@hyperbola.info> | 2021-05-24 21:17:59 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-05-24 21:17:59 -0500 |
commit | 1b860c69177a88257b841aab5511cd816fffed9b (patch) | |
tree | 3246e589bab489d37a4338a7c91665033404c952 | |
parent | ff8531cb84c1e89a49b2dc6e7b85a2d82775fa32 (diff) | |
download | yt-local-1b860c69177a88257b841aab5511cd816fffed9b.tar.lz yt-local-1b860c69177a88257b841aab5511cd816fffed9b.tar.xz yt-local-1b860c69177a88257b841aab5511cd816fffed9b.zip |
Not force plyr as player
-rw-r--r-- | settings.py | 12 | ||||
-rw-r--r-- | youtube/templates/watch.html | 25 |
2 files changed, 23 insertions, 14 deletions
diff --git a/settings.py b/settings.py index 1482db0..a2373da 100644 --- a/settings.py +++ b/settings.py @@ -148,11 +148,15 @@ For security reasons, enabling this is not recommended.''', 'category': 'playback', }), - ('use_video_hotkeys', { - 'label': 'Enable video hotkeys', - 'type': bool, - 'default': True, + ('use_video_player', { + 'type': int, + 'default': 1, 'comment': '', + 'options': [ + (0, 'Native'), + (1, 'Native with hotkeys'), + (2, 'Plyr'), + ], 'category': 'interface', }), diff --git a/youtube/templates/watch.html b/youtube/templates/watch.html index 993befc..a8442ca 100644 --- a/youtube/templates/watch.html +++ b/youtube/templates/watch.html @@ -5,9 +5,11 @@ {% block style %} <link href="/youtube.com/static/message_box.css" rel="stylesheet"/> <link href="/youtube.com/static/watch.css" rel="stylesheet"/> - <!-- plyr --> - <link href="/youtube.com/static/modules/plyr/plyr.css" rel="stylesheet"/> - <!--/ plyr --> + {% if settings.use_video_player == 2 %} + <!-- plyr --> + <link href="/youtube.com/static/modules/plyr/plyr.css" rel="stylesheet"/> + <!--/ plyr --> + {% endif %} {% endblock style %} {% block main %} @@ -350,13 +352,16 @@ </script> <script src="/youtube.com/static/js/common.js"></script> <script src="/youtube.com/static/js/transcript-table.js"></script> - <!-- plyr --> - <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> - <!-- /plyr --> - {% if settings.use_video_hotkeys %} <script src="/youtube.com/static/js/hotkeys.js"></script> {% endif %} + {% if settings.use_video_player == 2 %} + <!-- plyr --> + <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> + <!-- /plyr --> + {% elif settings.use_video_player == 1 %} + <script src="/youtube.com/static/js/hotkeys.js"></script> + {% endif %} {% if settings.use_comments_js %} <script src="/youtube.com/static/js/comments.js"></script> {% endif %} {% if settings.use_sponsorblock_js %} <script src="/youtube.com/static/js/sponsorblock.js"></script> {% endif %} {% endblock main %} |