Bug in 'YouTube iOS Player Helper' library
Asked Answered
R

1

8

I have been using the 'YouTube iOS Player Helper' library for playback of our youtube videos in our iOS App (iPhone).

Today I noticed a bug in the same, whenever it tries to load a video with 'In Stream Ads' it pauses the playback of video, closes our app and then opens mobile safari app with the link to "pubads.g.doubleclick.net" page. The page loads with a blank screen.

I repeatedly checked the app, this behaviour is consistent with all YouTube videos with 'In Stream Ads'. Also a video without any ads is working ie playing fine in the app without triggering mobile safari.

Any ideas on when this bug will be resolved?

I'm using iOS 8.1.2 (12B440) on iTouch 5th generation. I also get the same result in iPhone simulator also.

Thanks :)

Resolvable answered 7/1, 2015 at 13:1 Comment(0)
C
10

A temporary solution (until this problem is fixed) is adding another condition in the method shouldStartLoadWithRequest() that is located in the file YTPlayerView.m. The condition should intercept requests made to pubads.g.doubleclick.net.

The following lines solved the problem for me:

else if ([request.URL.host isEqual: @"pubads.g.doubleclick.net"])
{
         return NO; 
} 
Characharabanc answered 8/1, 2015 at 13:2 Comment(4)
The solution perfectly works. I suppose there is no way to solve the issue in the page (in the javascript code).Tadeas
Hi @Characharabanc I tried it out and it works well. I didn't think of this solution. I have informed the googlers on this. Any idea where to file a bug on this? And huge thanks buddy. :)Resolvable
Glad it helped. Try filing it from the ios library's Github page, and they should do the rest.Characharabanc
Looks like this has already been fixed here.Vernation

© 2022 - 2024 — McMap. All rights reserved.