Skip to content

Instantly share code, notes, and snippets.

@rposborne
Created December 15, 2015 19:00
Show Gist options
  • Save rposborne/840d24d88d2e6bf6d052 to your computer and use it in GitHub Desktop.
Save rposborne/840d24d88d2e6bf6d052 to your computer and use it in GitHub Desktop.
window.slow = false;
var slowLoad = window.setTimeout( function() {
window.slow = true;
}, 400 );
document.addEventListener('DOMContentLoaded', function() {
window.clearTimeout( slowLoad );
if (slow != true) {
var inputs = document.getElementsByTagName('video');
for(var i = 0; i < inputs.length; i++) {
inputs[i].setAttribute("autoplay", "autoplay");
inputs[i].setAttribute("preload", "auto");
}
};
}, false );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment