Last active
December 6, 2017 15:45
-
-
Save Lewiscowles1986/341778bac770fb953fe16512f8858e88 to your computer and use it in GitHub Desktop.
Simple way to set html5 playback rate. Should probably be minified as a bookmarklet
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
(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