I don't understand your question. One important thing to point out is
that the JavaScript for the <iframe> API should only be loaded once,
not repeatedly in a loop. And if you only plan on having on active
player, you also shouldn't create multiple YT.Player objects in a
loop.
Cheers,
-Jeff Posnick, YouTube API Team
groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
@YouTubeDev
On Mar 16, 6:58 am, Cheeeze <nosignal1...@gmail.com> wrote:
> Hello everyone !
>
> I've a problem with displaying videos.
>
> I succeed to display video in a boucle for but I need to put a javascript
> alert when I create each player.
>
> for(i=0;i<tabId.length;i++)
>         {
>
>             //This code loads the IFrame Player API code asynchronously.
>              var tag = document.createElement('script');
>              tag.src = "http://www.youtube.com/player_api";
>              var firstScriptTag =
> document.getElementsByTagName('script')[0];
>              firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
>
>             //This function creates an <iframe> (and YouTube player)after
> the API code downloads.
>             alert("baba");
>
>             var player1 = new YT.Player(tabId[i],{
>                     height: '150',
>                       width: '200',
>                       videoId: tabId[i].toString(),
>                     // the order of controls you want on the control bar
> (and other plugins below)
>                     events:{ 'onReady': playYouTubeVideo,
>                         'onStateChange': onPlayerStateChange
>                          }
>             });
>
>     } // End of for
>
> I thought about a time of loading, maybe...?? Can you help me?
> Thank you !
>
> Cheeeze
-- 
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
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