Created
May 10, 2010 21:04
-
-
Save brianmichel/396543 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
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(); } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment