Last active
July 24, 2018 21:52
-
-
Save kevinkace/472239ffe6c891669c78c8b97dbfd380 to your computer and use it in GitHub Desktop.
tamper monkey script for youtube/netflix playback speed (to blast through movies @130%), numpad 1/3 to lower/increase speed by 10%
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Netflix playback speed | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description numpad 1, 2, 3 for --0.1, 0, ++0.1 | |
// @author Kevin Cameron | |
// @include https://www.netflix.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
"use strict"; | |
var node = document.createElement("div"), | |
style = { | |
on : "color:white; position: relative; z-index: 1;", | |
off : "opacity: 0;" | |
}; | |
node.style = style.off; | |
document.body.appendChild(node); | |
addEventListener("keydown", (e) => { | |
let video = document.querySelectorAll("video")[0]; | |
if(e.keyCode === 97) { | |
video.playbackRate = video.playbackRate - 0.1; | |
} else if(e.keyCode === 99) { | |
video.playbackRate = video.playbackRate + 0.1; | |
} | |
node.innerText = `playbackRate: ${video.playbackRate.toFixed(2)}`; | |
node.style = style.on; | |
setTimeout(() => { node.style = style.off; }, 1000); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment