Friday, January 13, 2012

[YouTube-API] Re: onStateChange not firing in Chrome 16

Hello,

When I visit http://www.thegreatrecovery.com/live and start playback
in Chrome, I do see an error in the console stating "Uncaught
SyntaxError: Unexpected token ILLEGAL". It identifies the source of
that error as youtube_video_helper.js line 5, which is

ytplayer.loadVideoById(this.href.split('?')[1].split('=')[1]);

If you evaluate this.href.split('?')[1].split('=')[1] in the JS
console (or just look at the href attribute of that <a> element)
you'll see that it evaluates to "JKohvK4dqW0&nomobile", which isn't a
valid YouTube video id. You need to be a bit more careful in how
you're parsing a YouTube video id out of a YouTube watch page URL, as
you're not accounting for other parameters that might be present.

So while there might be some underlying problem with the Player API
itself, you'd really need to fix that basic problem with your code
first and try again before it illustrates anything definitive.

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


On Jan 13, 1:53 pm, RagingPacifist <mohicanl...@gmail.com> wrote:
> Here's an example of what I'm seeing:http://www.thegreatrecovery.com/live
>
> if you look on line 331 of scode.js included in that page:
> this.p.addEventListener("onStateChange","adytt.pl['"+a+"'].st")
>
> It throws a javascript error, the message is different for each
> browser.
> Firefox w/ Firebug throws a "missing exponent" and points to this:
> try { __flash__toXML(adytt%2Epl%5B%27myytplayer%27%5D%2Est(5)) ; }
> catch (e) { "...
>
> It looks like it's html encoding the period in the callback argument.
>
> Chrome just says
> Uncaught SyntaxError: Unexpected token ILLEGAL
>
> Adding version=3 as a parameter to the video url fixes the issue. I'm
> not sure why that's necessary now, when it wasn't 2 days ago. Does it
> default to the AS2 player now if version isn't specified?
>
> On Jan 13, 10:55 am, Jeffrey Posnick <je...@google.com> wrote:
>
>
>
>
>
>
>
> > Hello Folks,
>
> >  If anyone is experiencing an ongoing error with onStateChange not
> > firing, could you please point me to a specific URL I could visit to
> > reproduce the issue?
>
> > Cheers,
> > -Jeff Posnick, YouTube API Team
> > groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
> > @YouTubeDev
>
> > On Jan 12, 5:25 pm, RagingPacifist <mohicanl...@gmail.com> wrote:
>
> > > I'm also having an issue with the onStateChange event that started on
> > > 1/11/2012 at about 6pm CT.
> > > I'm using this plugin (http://www.adlytics.de/omniture/plugins/youtube-
> > > player-tracking.htm) to track youtube activity on my site but it is
> > > throwing a javascript error.
>
> > > This line causes the javascript error:
> > > adytt.p.addEventListener("onStateChange","adytt.st");
>
> > > The issue seems to be the . in the call back, prior to yesterday
> > > passing on object.function as the callback worked fine, now it fails.
>
> > > On Jan 12, 2:05 pm, Peppi <donna...@gmail.com> wrote:
>
> > > > Hi,
>
> > > > Just wondering if something has changed with the Javascript Player API? The
> > > > onStateChange event is no longer firing as of today it looks like.
>
> > > > Thx.

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