Created
December 19, 2011 01:20
-
-
Save dmolsen/1495027 to your computer and use it in GitHub Desktop.
Examples of two onStateChange events
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
// listen for when the viewer decides to start playing the video | |
// hide the intro & outro text divs as well as "lower the lights" | |
YTVideo.on('playing', function() { | |
document.getElementById('intro').setAttribute('class', 'text hide'); | |
document.getElementById('outro').setAttribute('class', 'text hide'); | |
document.getElementById('lights').setAttribute('class', 'darken'); | |
}); | |
// listen for when the video ends | |
// show the outro text div as well as "bring up the lights" | |
YTVideo.on('ended', function() { | |
document.getElementById('outro').setAttribute('class', 'text show'); | |
document.getElementById('lights').setAttribute('class', 'lighten'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment