From 8b745907cc6aab2df71e6eb0de1f6b76564aad33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Tue, 14 Sep 2021 14:49:14 -0500 Subject: improve quality-select --- youtube/static/js/watch.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'youtube/static/js/watch.js') 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}; -- cgit v1.2.3