Created
February 20, 2024 14:07
-
-
Save DarrenRainey/47eaa7af17f3bdef5d94ba72dbe0ce93 to your computer and use it in GitHub Desktop.
Pause YouTube video after x seconds
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
// Darren Rainey 2024 - github.com/Darren | |
// | |
// A Simple javascript snippet to pause a youtube video after x seconds | |
// Simply copy and paste in Chrome devtools / console and run | |
// pause(60) to pause the current video after 60 seconds. | |
function pause(timeInSeconds){ | |
seconds = timeInSeconds * 1000 | |
setTimeout(() => { | |
document.getElementsByClassName("ytp-play-button ytp-button")[0].click() | |
}, seconds) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment