From 06e091e020a2fecd1ef927edc4f55e999804b5f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Wed, 1 Sep 2021 15:14:06 -0500 Subject: watch.js: video variable as const and improve data.time_start syntax --- youtube/static/js/watch.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'youtube') diff --git a/youtube/static/js/watch.js b/youtube/static/js/watch.js index 38aab3f..f7e6285 100644 --- a/youtube/static/js/watch.js +++ b/youtube/static/js/watch.js @@ -1,4 +1,4 @@ -var video = document.getElementById('js-video-player'); +const video = document.getElementById('js-video-player'); function changeQuality(selection) { var currentVideoTime = video.currentTime; @@ -40,8 +40,7 @@ document.getElementById('quality-select').addEventListener( ); // Set up video start time from &t parameter -if (data.time_start != 0 && video) - video.currentTime = data.time_start; +if (data.time_start != 0 && video) {video.currentTime = data.time_start}; // External video speed control var speedInput = document.getElementById('speed-control'); -- cgit v1.2.3