Created
May 11, 2010 02:59
-
-
Save brianmichel/396869 to your computer and use it in GitHub Desktop.
This file contains 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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
</head> | |
<body> | |
<video id="video"> | |
<source src="debacle_720p.mp4"> | |
Video Not Supported | |
</video> | |
<script type="text/javascript"> | |
var video = document.getElementById('video'); | |
var rewind = document.getElementById('rewind'); | |
var playpause = document.getElementById('playpause'); | |
video.addEventListener('play', playing, false); | |
video.addEventListener('pause', paused, false); | |
playpause.addEventListener('click', playPauseToggle, false); | |
function playPauseToggle(e) { | |
if (playpause.value == 'Play') { | |
video.play(); | |
playpause.value = 'Pause'; | |
} else { | |
video.pause(); | |
playpause.value = 'Play'; | |
} | |
} | |
function playing(e) { | |
playpause.value = 'Pause'; | |
playpause.onClick = function() { video.pause(); } | |
} | |
function paused(e) { | |
playpause.value = 'Play' | |
playpause.onClick = function() { video.play(); } | |
} | |
</script> | |
<input id="playpause" type="button" value="Play"> | |
<input type="button" value="Pause"> | |
<input id="rewind" type="button" value="Rewind" onclick="video.currentTime = 0;"> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment