Skip to content

Instantly share code, notes, and snippets.

@the-sides
Created December 13, 2020 07:26
Show Gist options
  • Save the-sides/1a85a842d7f3a68f651a9516f39b1d74 to your computer and use it in GitHub Desktop.
Save the-sides/1a85a842d7f3a68f651a9516f39b1d74 to your computer and use it in GitHub Desktop.
Netflix function for going back ~5 secs rather than 10
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