Google IMA3 SDK, VAST on iOS - dispatching event mediaLoadTimeout

2.3k views Asked by At

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:

  1. @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())
  2. @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.

2

There are 2 answers

0
Ji Mun On BEST ANSWER

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.

0
Moryachok On

Something that I discovered, first of all you cannot implement more than one video element into a page, so your IMA3 videotag will not appear in order to play a video on mobile devices. As you already said, you need to run video ad manually from your video tag.

Something that will help you avoid timeout (by default is 15 seconds, and this is not enough to get video ads on mobile) error is :

var adsRenderingSettings = new google.ima.AdsRenderingSettings();
adsRenderingSettings.loadVideoTimeout = 100000;
adsManagerLoadedEvent.getAdsManager({currentTime: 0}, adsRenderingSettings); // calling the adsManager

https://developers.google.com/interactive-media-ads/docs/sdks/html5/v3/apis#ima.AdsRenderingSettings

Good Luck