I am currently working on using Google's IMA3 SDK to show third party ads. My implementation works on browsers, but not on iOS Safari and iOS Chrome, where I get timeout error.
Output from IMA3 SDK Debugging version:
[Debug] [ 31.706s] [ima.vast.VideoAdEventTracker] dispatching event mediaLoadTimeout (bridge3.1.79_debug_en.html, line 427)
[Debug] [ 31.713s] [ima.managers.VastVideoAdsManager] Playback error: [object Object] (bridge3.1.79_debug_en.html, line 427)
[Warning] [ 31.731s] [ima.common.ErrorUtils] Error play dispatched: AdError 402: VAST media file loading reached a timeout of 15 seconds. (bridge3.1.79_debug_en.html, line 427)
I'm currently assuming that maybe the VAST for iOS is different than Desktop or Android, and that is why I'm seeing this timeout error. However, I cannot find find a network requests (made to http://shadow01.yumenetworks.com/...
. in Safari's Web Inspector >> Timeline >> Network Requests tab. (I also can't find it on Safari on OSX, but it works on Safari/OSX. Frustrating pat is I can find the network request and response in Chrome dev tool, but I can't use Chrome dev tool for iOS debugging purpose.)
This is how I'm setting up the AdRequest, following the Google IMA3 SDK API:
sendAdRequest: (networkURL) ->
@adsRequest = new google.ima.AdsRequest()
@adsRequest.adTagUrl = "http://shadow01.yumenetworks.com/..."
@adsRequest.adType = "video"
@adsRequest.linearAdSlotWidth = 480
@adsRequest.linearAdSlotHeight = 360
@adsLoader.requestAds(@adsRequest)
Sometimes I see a thumb/still of the ad video showing up, but I am not able to play the video, then after some time, I get the timeout error. Sometimes nothing loads in the video player, and I see the timeout error.
Anyone have insights on why the ad videos would not work on iOS browsers? I'm new on html5 videos and VAST business. Thanks in advance!
Bit more debugging and playing around in the console:
After setting up the AdsManager:
- @adsManager.start() => I can see a still of the video, but the video doesn't play (According to the API, the video should start playing if I call start())
- @adsManager.play() => Nothing happens initially, but I get a 15 sec timeout error message afterward.
I tried sticking in one of the videos from the VAST object directly in a HTML5 video player, and that played fine, so I am assuming that I have some issues with the VAST object, or how IMA3 is handling things.
The problem was I was calling AdDisplayContainer.initialize() in the wrong place (not after a click event is detected). Otherwise, iOS prevents video from playing.