diff options
-rw-r--r-- | youtube/static/js/plyr-start.js | 7 | ||||
-rw-r--r-- | youtube/static/js/watch.js | 11 | ||||
-rw-r--r-- | youtube/templates/watch.html | 18 |
3 files changed, 16 insertions, 20 deletions
diff --git a/youtube/static/js/plyr-start.js b/youtube/static/js/plyr-start.js index 82b32d6..763a492 100644 --- a/youtube/static/js/plyr-start.js +++ b/youtube/static/js/plyr-start.js @@ -118,11 +118,4 @@ }, settings: ['captions', 'quality', 'speed', 'loop'], }); - - // Hide the external quality selector - window.addEventListener('DOMContentLoaded', function(){ - const qs = document.getElementById('quality-select'); - if (qs) - qs.hidden = true; - }); }()); diff --git a/youtube/static/js/watch.js b/youtube/static/js/watch.js index 0954f5b..acc6b28 100644 --- a/youtube/static/js/watch.js +++ b/youtube/static/js/watch.js @@ -31,11 +31,12 @@ if (data.using_pair_sources) { } // Quality selector -document.getElementById('quality-select').addEventListener( - 'change', function(e) { - changeQuality(JSON.parse(this.value)) - } -); +const qs = document.getElementById('quality-select'); +if (qs) { + qs.addEventListener('change', function(e) { + changeQuality(JSON.parse(this.value)) + }); +} // Set up video start time from &t parameter if (data.time_start != 0 && video) {video.currentTime = data.time_start}; diff --git a/youtube/templates/watch.html b/youtube/templates/watch.html index 6aa7e42..84585a2 100644 --- a/youtube/templates/watch.html +++ b/youtube/templates/watch.html @@ -82,14 +82,16 @@ <div class="external-player-controls"> <input class="speed" id="speed-control" type="text" title="Video speed"> - <select id="quality-select" autocomplete="off"> - {% for src in uni_sources %} - <option value='{"type": "uni", "index": {{ loop.index0 }}}' {{ 'selected' if loop.index0 == uni_idx and not using_pair_sources else '' }} >{{ src['quality_string'] }}</option> - {% endfor %} - {% for src_pair in pair_sources %} - <option value='{"type": "pair", "index": {{ loop.index0}}}' {{ 'selected' if loop.index0 == pair_idx and using_pair_sources else '' }} >{{ src_pair['quality_string'] }}</option> - {% endfor %} - </select> + {% if settings.use_video_player != 2 %} + <select id="quality-select" autocomplete="off"> + {% for src in uni_sources %} + <option value='{"type": "uni", "index": {{ loop.index0 }}}' {{ 'selected' if loop.index0 == uni_idx and not using_pair_sources else '' }} >{{ src['quality_string'] }}</option> + {% endfor %} + {% for src_pair in pair_sources %} + <option value='{"type": "pair", "index": {{ loop.index0}}}' {{ 'selected' if loop.index0 == pair_idx and using_pair_sources else '' }} >{{ src_pair['quality_string'] }}</option> + {% endfor %} + </select> + {% endif %} </div> <input class="v-checkbox" name="video_info_list" value="{{ video_info }}" form="playlist-edit" type="checkbox"> |