
Untitled
By: a guest on
Sep 11th, 2012 | syntax:
None | size: 0.43 KB | hits: 5 | expires: Never
onYouTubePlayerReady = function( playerId ) {
ytplayer = document.getElementById( "video_container" );
ytplayer.addEventListener("onStateChange", "onytplayerStateChange");
ytplayer.addEventListener("onError", "onytplayerError");
ytplayer.playVideo();
}
function onytplayerStateChange(newState) {
if( newState == 0 ) {
playNextVideo();
}
}
// on error just go to next vid
function onytplayerError(error) {
playNextVideo()
}