Created
April 30, 2024 16:33
-
-
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.
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
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