Created
December 13, 2020 07:26
-
-
Save the-sides/1a85a842d7f3a68f651a9516f39b1d74 to your computer and use it in GitHub Desktop.
Netflix function for going back ~5 secs rather than 10
This file contains 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
function back5() { | |
const goBack10secsButton = document.querySelector('.button-nfplayerBackTen'); | |
const video = document.querySelector('.VideoContainer video') | |
// Go back 10 seconds | |
goBack10secsButton.click(); | |
// Speed up the video | |
video.playbackRate = 10; | |
// After 750 ms, resume normal speed | |
setTimeout(() => { | |
video.playbackRate = 1; | |
}, 750); | |
}; | |
// Activate once the 'a' key is pressed | |
document.addEventListener('keypress', (e) => { | |
if (e.key === 'a') back5(); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment