Skip to content

Instantly share code, notes, and snippets.

@DimaGashko
Last active November 5, 2020 23:51
Show Gist options
  • Save DimaGashko/807de8a67f7fabbc08e3641650ecce30 to your computer and use it in GitHub Desktop.
Save DimaGashko/807de8a67f7fabbc08e3641650ecce30 to your computer and use it in GitHub Desktop.
Console.Youtube
// Prevent autopause when youtube is plaing in the background
v = $('video');
v.onpause = () => v.play();
// To disable
v.onpause = null;
// Prevent autopause when youtube is plaing in the background
allowPause = false;
const video = document.querySelector('video');
video.onpause = () => {
if (allowPause) return;
video.play();
}
@DimaGashko
Copy link
Author

DimaGashko commented Oct 30, 2020

Autopause when youtube is plaing in the background:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment