diff options
Diffstat (limited to 'youtube/static/js/watch.js')
-rw-r--r-- | youtube/static/js/watch.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/youtube/static/js/watch.js b/youtube/static/js/watch.js index f7e6285..0954f5b 100644 --- a/youtube/static/js/watch.js +++ b/youtube/static/js/watch.js @@ -4,16 +4,15 @@ function changeQuality(selection) { var currentVideoTime = video.currentTime; var videoPaused = video.paused; var videoSpeed = video.playbackRate; - var videoSource; + var srcInfo; if (avMerge) avMerge.close(); if (selection.type == 'uni'){ - videoSource = data['uni_sources'][selection.index]; - video.src = videoSource.url; + srcInfo = data['uni_sources'][selection.index]; + video.src = srcInfo.url; } else { - let srcPair = data['pair_sources'][selection.index]; - videoSource = srcPair[0]; - avMerge = new AVMerge(video, srcPair, currentVideoTime); + srcInfo = data['pair_sources'][selection.index]; + avMerge = new AVMerge(video, srcInfo, currentVideoTime); } video.currentTime = currentVideoTime; if (!videoPaused){ @@ -26,7 +25,6 @@ function changeQuality(selection) { var avMerge; if (data.using_pair_sources) { var srcPair = data['pair_sources'][data['pair_idx']]; - var videoSource = srcPair[0]; // Do it dynamically rather than as the default in jinja // in case javascript is disabled avMerge = new AVMerge(video, srcPair, 0); |