Skip to content

Instantly share code, notes, and snippets.

Created November 8, 2013 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/7375573 to your computer and use it in GitHub Desktop.
Save anonymous/7375573 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script>
window.onload = function () {
var v = document.getElementById("myVideo");
var p = document.getElementById("pbr");
var cp = document.getElementById("currentPbr");
p.addEventListener('input',function(){
cp.innerHTML = p.value;
v.playbackRate = p.value;
},false);
};
</script>
</head>
<body>
<div style="width:640px; height:360; margin: 0 auto; margin-bottom:14em">
<video id="myVideo" controls>
<source src="http://hyperaud.io/video/obama-responds.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
<source src="http://hyperaud.io/video/obama-responds.webm" type='video/webm; codecs="vp8, vorbis"' />
</video>
<form>
<p></p>
<input id="pbr" type="range" value="1" min="0.1" max="10" step="0.1" style="width:100%">
<p>Playback Rate <span id="currentPbr">1</span></p>
</form>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment