Skip to content

Instantly share code, notes, and snippets.

@karx
Created February 25, 2020 04:04
Show Gist options
  • Save karx/923401e7ab38753d988ce9accff1257c to your computer and use it in GitHub Desktop.
Save karx/923401e7ab38753d988ce9accff1257c to your computer and use it in GitHub Desktop.
Document onload then play video. Not recommended ‼
document.addEventListener('DOMContentLoaded', function(){
// pushThePlayButton();
setTimeout(pushThePlayButton, 2600);
}, false)
function pushThePlayButton() {
let vids = document.getElementsByClassName("video-autoplay-pusher");
console.log(vids);
[...vids].forEach(element => {
console.log(element);
element.play();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment