Friday, January 20, 2012

[YouTube-API] Re: iframe API multiple instances of player breaking events

Hello Ash,

Please see

https://groups.google.com/group/youtube-api-gdata/browse_thread/thread/cba53817e843603d#

You might want to create an additional parent <div> one level up from
the <div> that's being replaced, or work around the new behavior in
another similar method.

Cheers,
-Jeff Posnick, YouTube API Team
groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
@YouTubeDev


On Jan 19, 9:05 pm, Ash Warren <losthum...@gmail.com> wrote:
> So we have a FB app that has been working perfectly for the last month
> or so and just over the last few days has started to display some very
> odd behavior.  Currently we have a div named "videoFrame" which we
> pass to a new instance of the player like so:
>
> BS.vidPlayer = new YT.Player ('videoFrame',
> {
>         height: '295',
>         width: '493',
>         videoId : '6NjDDFIV7Z8',
>         events:
>         {
>                 'onReady': onPlayerReady,
>                 'onStateChange': onPlayerStateChange,
>                 'onError' : onPlayerError
>         }
>
> });
>
> What we are doing is each time you click on a video link it will run
> the same bit of code (above) but pass in a different "videoId".  Up
> until recently this was working perfectly essentially swapping out the
> previous iframe with the new one..  However, now the second (or next)
> time you instantiate the player it breaks and none of the events will
> fire.
>
> If anyone could point me in the right direction to a solution I would
> be very grateful.
>
> Thank you!

--
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