Created
June 7, 2016 20:14
-
-
Save thehig/3e03084674b1dd4a08f98b37fa5b4ccb to your computer and use it in GitHub Desktop.
js: playbackrate
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
/* | |
Locate all video elements on a page and attempt to set their playback rate to 2.0 | |
Convert to single line using Sublimes Ctrl-A Ctrl-J | |
*/ | |
(function(global){ | |
var elems = document.getElementsByTagName("video"); | |
for(var i = 0; i<elems.length; i++){ | |
try { | |
var elem = elems[i]; | |
elem.playbackRate = 2; | |
} | |
catch(e){ | |
/*no-op*/ | |
} | |
} | |
})(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$.get("https://gist.githubusercontent.com/thehig/3e03084674b1dd4a08f98b37fa5b4ccb/raw/f78a83e31555824c36e16cb3681b259bbec5c598/playbackrate.js").then(function(r){eval(r);});