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 :)
The youtube-ios-player-helper is an open source library that helps you embed a YouTube iframe player into an iOS application.
In this example, we are going to add the YouTube Player iOS Helper library into our project using Cocaopods. Next, in the swift file of your ViewController, add with drag and drop the YTPlayerView and add import youtube_ios_player_helper at the top of your file.
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;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With