aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/static/js/speedyplay.js
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2020-12-29 15:36:23 -0500
committerJesús <heckyel@hyperbola.info>2020-12-29 15:36:23 -0500
commit0f78e73e80dd1801bbcadb31e2bd3de11b68b267 (patch)
tree1d54e0cc482cf14754e660f6ad1de6fa408b93e7 /youtube/static/js/speedyplay.js
parent701786a9cc0aa21ef83fa17139599814662cf869 (diff)
downloadyt-local-0f78e73e80dd1801bbcadb31e2bd3de11b68b267.tar.lz
yt-local-0f78e73e80dd1801bbcadb31e2bd3de11b68b267.tar.xz
yt-local-0f78e73e80dd1801bbcadb31e2bd3de11b68b267.zip
General theme: add license and add URL source code in footer
Diffstat (limited to 'youtube/static/js/speedyplay.js')
-rw-r--r--youtube/static/js/speedyplay.js13
1 files changed, 13 insertions, 0 deletions
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;
+ }
+ }
+ });
+}());