diff options
author | Jesús <heckyel@hyperbola.info> | 2021-09-14 14:49:14 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-09-14 14:49:14 -0500 |
commit | 8b745907cc6aab2df71e6eb0de1f6b76564aad33 (patch) | |
tree | 616eaa9cfb897a55ffd68ad8cc767ae5888e484c /youtube/static/js/watch.js | |
parent | ecb8d406f85b734cb32bf7a5dda602fb3c377ac6 (diff) | |
download | yt-local-8b745907cc6aab2df71e6eb0de1f6b76564aad33.tar.lz yt-local-8b745907cc6aab2df71e6eb0de1f6b76564aad33.tar.xz yt-local-8b745907cc6aab2df71e6eb0de1f6b76564aad33.zip |
improve quality-select
Diffstat (limited to 'youtube/static/js/watch.js')
-rw-r--r-- | youtube/static/js/watch.js | 11 |
1 files changed, 6 insertions, 5 deletions
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}; |