2
votes

Has anybody successfully implemented the Google IMA HTML5 SDK in IOS? They say that you should make the call to request ads based on a user interaction. I would assume that means when they click play on the player. How do I do that? I've tried detecting onClick on the player but for some reason it can't seem to catch that event. I can make the call to request ads right when the view loads, but then the ad clip loads in the player and you see the poster image for the ad instead of the actual clip. I don't want that.

Also, I would like the actual video clip to play automatically after the ad has finished playing. Right now the user has to click play to play the ad and then they have to click play again to watch the actual clip. Not a good user experience at all.

1
Did you ever find a solution for this, Jeremy? I'm struggling with the same issue now without much luck. Even Google's "advanced" IMA HTML5 SDK code doesn't work for video pre-roll on iOS. - Mark
I actually got it to work. The trick in my case was to move the "play" button off of the <video> element, because apparently iOS intercepts all clicks that occur on <video> tags. - Mark

1 Answers

0
votes

If you have access to the app's objective-c code, make sure that the UIWebView mediaPlaybackRequiresUserAction property in your app is set to NO and the allowsInlineMediaPlayback property is set to YES.

More info here: https://developer.apple.com/library/ios/documentation/uikit/reference/UIWebView_Class/Reference/Reference.html#//apple_ref/occ/instp/UIWebView/mediaPlaybackRequiresUserAction