From 0f78e73e80dd1801bbcadb31e2bd3de11b68b267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Tue, 29 Dec 2020 15:36:23 -0500 Subject: General theme: add license and add URL source code in footer --- youtube/static/js/speedyplay.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 youtube/static/js/speedyplay.js (limited to 'youtube/static/js/speedyplay.js') diff --git a/youtube/static/js/speedyplay.js b/youtube/static/js/speedyplay.js new file mode 100644 index 0000000..58b5d33 --- /dev/null +++ b/youtube/static/js/speedyplay.js @@ -0,0 +1,13 @@ +(function main() { + 'use strict'; + const video = document.getElementById('js-video-player'); + const speedInput = document.getElementById('speed-control'); + speedInput.addEventListener('keyup', (event) => { + if (event.key === 'Enter') { + let speed = parseFloat(speedInput.value); + if(!isNaN(speed)){ + video.playbackRate = speed; + } + } + }); +}()); -- cgit v1.2.3