Thursday, April 19, 2012

[YouTube-API] player.loadVideoById is not a function

Hi ! 
I hope you can help me . :-) 

When I want to play another video in the player, I've error : player.loadVideoById is not a function


function onYouTubePlayerAPIReady(id) {
player = new YT.Player('player', {
   height: '390',
   width: '640',
   videoId: id,
   playerVars: { 
    'autoplay': 0, 
    'rel': 0, 
   
   },
   events: {
     'onReady': onPlayerReady,
     'onStateChange': onPlayerStateChange
   }
 });
}
function onPlayerStateChange(event) {
 if (event.data == YT.PlayerState.ENDED ) 
 {
//onYouTubePlayerAPIReady('fTa3fj8O_M4'); // He recognize id but doesn't create the player
 player.loadVideoById('fTa3fj8O_M4',0); // Not a function
  
 }
}


Thank you for your help, 

Cheeeze ;-)

--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To view this discussion on the web visit https://groups.google.com/d/msg/youtube-api-gdata/-/tkQzwtmWNkcJ.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.

No comments:

Post a Comment