Created
January 11, 2009 22:28
-
-
Save anveo/45822 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/* This works when jQuery is not included */ | |
function onYouTubePlayerReady(playerId) { | |
ytplayer = document.getElementById("myytplayer"); | |
ytplayer.addEventListener("onStateChange", "onytplayerStateChange"); | |
} | |
function onytplayerStateChange(newState) { | |
console.debug("Player's new state: " + newState); | |
} | |
onYouTubePlayerReady('myytplayer'); | |
/* This doesn't work */ | |
$('#myytplayer').bind('onStateChange', function(newState) { | |
console.debug("Player's new state: " + newState); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment