Skip to content

Instantly share code, notes, and snippets.

@ajtazer
Created April 30, 2024 16:33
Show Gist options
  • Save ajtazer/93fe2c5dd5d8e49484a99f75e9d0b770 to your computer and use it in GitHub Desktop.
Save ajtazer/93fe2c5dd5d8e49484a99f75e9d0b770 to your computer and use it in GitHub Desktop.
if anyone is like me and gets distracted from the lecture playlist often, paste this code in your browser console, and it will auto play the video 15 secs after you pausing it. Works great for my adhd.
async function checkAndResumeVideo() {
const videoElement = document.querySelector('video');
if (videoElement) {
if (videoElement.paused) {
await new Promise(resolve => setTimeout(resolve, 15000));//apne hisaab se time change karlo
videoElement.play();
}
}
}
setInterval(checkAndResumeVideo, 20000);//yaha bhi karlo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment