Friday, January 13, 2012

[YouTube-API] Re: Youtube Iframe in ios uiwebview not working

Hello Jeffrey,

thanks a lot for your answer, i just tried to add this event handler:

function onPlayerError(data) {
alert("Youtube error : " + data);
}

and here is my player init :

player = new YT.Player('divplayer', {
width: '100%',
height: 240,
videoId: video_id,

playerVars: { 'autoplay': 0, 'playerapiid':
'ytPlayer', 'egm': 0, 'wmode': 'opaque', 'fs': 1, 'autohide': 1,
'showinfo': 0, 'modestbranding': 1, 'showsearch': 0, 'iv_load_policy':
3, 'cc_load_policy': 0, 'hd': 1, 'disablekb': 0, 'version': 3, 'rel':
0 },


events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange,
'onError': onPlayerError
}
});


I got no alert ...

The strange thing is that it works perfectly in safari but not always
on the iphone youzeek app

Stranger ... this bug looks like it's happening only on the iphone
4S ...

Any other ideas ?

Best regards,
Joseph

On 6 jan, 16:32, Jeffrey Posnick <je...@google.com> wrote:
> Hello PJ,
>
>  There's an example of how to handle onError events at
>
>  http://code.google.com/apis/youtube/iframe_api_reference.html#Events
>  http://code.google.com/apis/youtube/iframe_api_reference.html#Examples
>
> Cheers,
> -Jeff Posnick, YouTube API Team
> groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
> @YouTubeDev
>
> On Jan 5, 1:49 pm, PJ Gray <p...@evertrue.com> wrote:
>
>
>
>
>
>
>
> > I can confirm I am getting this exact error as well.  Sometimes I get
> > the play with slash error, sometimes it plays.   I am using this
> > iframe code:
>
> >     NSString *htmlString = [NSString stringWithFormat:@"<iframe type=
> > \"text/html\" width=\"320.0f\" height=\"180.0f\" src=\"http://www.youtube.com/embed/%@\" frameborder=\"0\" allowfullscreen></
> > iframe>", thisId];
>
> > How can I trap the onError?
>
> > thanks,
>
> > -pj
>
> > On Dec 5 2011, 3:50 pm, Jeffrey Posnick <je...@google.com> wrote:
>
> > > Hello Joseph,
>
> > >  I don't have any knowledge of similar unreproducible playback
> > > failures with the <iframe> embed in a UIWebView. That thread you link
> > > to, for instance, is focused on the <object>/<embed> embed code, which
> > > behaves quite differently.
>
> > >  Are you handling the onError event raised by the player? Is it
> > > triggered when you see the loading failures, and if so, what's the
> > > error that's raised?
>
> > > Cheers,
> > > -Jeff Posnick, YouTube API Team
> > > groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
> > > @YouTubeDev
>
> > > On Dec 1, 8:09 am, Joseph Benguira <z51...@gmail.com> wrote:
>
> > > > Hello
>
> > > > i have a really strange bug, i'm using a youtube iframe in a uiwebview
> > > > on ios 5.
>
> > > > Sometimes it work correctly ... and sometimes not ...
>
> > > > when not working, i get a play symbole slashed (like unable to play
> > > > the video)  and every single video i try to play have the same issue.
>
> > > > i was unable to find the origin ...
>
> > > > this is not video dependant because sometimes, after rebooting the
> > > > device, or killing & restarting the app, i'm able to watch every video
> > > > without error
>
> > > > restarting the device or the app don't solve the issue each time ...
>
> > > > Another really strange thing is that it always work perfectly in
> > > > safari !!!!
>
> > > > the uiwebview show this url :http://youzeek.com/helixmini.aspx
>
> > > > any ideas ?
>
> > > > i find another topic with a similar issue :http://groups.google.com/group/youtube-api-gdata/browse_thread/thread...

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