Watch YouTube videos from YouTube iFrame

I am currently developing an iOS application that displays my videos on YouTube, I am a YouTube partner, and video ads appear when I play my videos in my browser. However, when using the official iOS YouTube Player, it doesn’t show any video ads, does anyone know how to show video ads or fix it?

YouTube Player Library I use https://github.com/youtube/youtube-ios-player-helper

Here are the options I use

NSDictionary *playerVars = @{ @"controls" : @1, @"playsinline" : @1, @"autohide" : @0, @"showinfo" : @0, @"autoplay" : @1, @"fs" : @0, @"rel" : @0, @"loop" : @1, @"enablejsapi" : @1, @"modestbranding" : @1 }; 

As you can see in this image, it simply starts playing the video and does not play the video ad before the video

enter image description here

+6
ios objective-c youtube youtube-api ytplayerview
source share
1 answer

When the YTPlayerView iFrame loaded the ad, it was used to force the user to be removed from his application and into Safari. I opened the problem on the GitHub library project page back in January , and it was discussed here in StackOverflow: Error in YouTube library iOS Player Helper .

Ultimately, iFrame ads were disabled in PR # 58 . This was authorized by Ibrahim Ulukai, YouTube Developer Relations Officer.

With the iFrame API out of date anytime , I won’t be surprised that YouTube is working on a better library for iOS, similar to the one they have for Android. But for now, ads will not be displayed in YTPlayerView .

+3
source share

All Articles