Skip to content

Instantly share code, notes, and snippets.

@thehig
Created June 7, 2016 20:14
Show Gist options
  • Save thehig/3e03084674b1dd4a08f98b37fa5b4ccb to your computer and use it in GitHub Desktop.
Save thehig/3e03084674b1dd4a08f98b37fa5b4ccb to your computer and use it in GitHub Desktop.
js: playbackrate
/*
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