Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple way to set html5 playback rate. Should probably be minified as a bookmarklet
(function(){
function setAllMediaPlaybackSpeed(speed) {
[].slice.call(document.querySelectorAll('audio,video')).map( function(e, idx) {
e.playbackRate = speed;
});
}
var userRequestedRate = parseFloat(prompt("What playback rate would you like?"),10);
if(!isNaN(userRequestedRate)) {
setAllMediaPlaybackSpeed(userRequestedRate);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.