Embed URL


SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Examples of two onStateChange events

View gist:1495027
1 2 3 4 5 6 7 8 9 10 11 12 13 14
// 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
Something went wrong with that request. Please try again.