IMA SDK ad preload [Android TV]

788 views
Skip to first unread message

Igor

unread,
Feb 13, 2022, 8:39:57 AM2/13/22
to Interactive Media Ads SDK
We are using your SDK for displaying ads for Android TV. We've bumped into the following issue:
1. Preload Ad.
2. Start playing ad
3. Nothing happens for a few seconds. Black screen.
4. We either get a timeout error (8 sec?) or ad starts playing.

When running test ads suggested by IMA SDK, no timeout issues happen. However, a few months ago the ad started immediately when preload was enabled. Now it takes aound a second for ad to start.

We didn't change anything in the application, same integration code, same IMA SSK. We suspect this might be because of our ad provider servers (they claim this is not the case though) but test ads from Google have issues either.

Is it possibel you might have changed something which is loaded by SDK from internet or any changes in Google Chrome could be the reason? Any ideas/help would be appreciated.

Igor

unread,
Feb 13, 2022, 11:31:59 AM2/13/22
to Interactive Media Ads SDK
P.S.
  here's the timeout error message:
> Ad Error: VAST media file loading reached a timeout of 8 seconds.

IMA SDK

unread,
Feb 13, 2022, 10:48:38 PM2/13/22
to ig...@wildspike.com, ima...@googlegroups.com

Hello Igor,

 

I'm Michael from IMA SDK Team, thank you for reaching out.

 

There could be different reasons for that specific error but most common is a slow internet connection. That said, it could simply be resolved by increasing the timeout value through setVastLoadTimeout parameter, this will specify the VAST load timeout in milliseconds for a single wrapper and should override the default value.

 

Let us know should you still encounter the same issue after the recommendation.

Regards,

Google Logo
Michael Angelo
IMA SDK Team
 


ref:_00D1U1174p._5004Q2WvEf5:ref

Igor

unread,
Feb 14, 2022, 5:36:27 AM2/14/22
to Interactive Media Ads SDK
Hi Michael.

  That makes sense. However, please, let me note that we do preloading. So I would expect chrome web view to pre-cache the video and start it almost immediately when we call adsManager.start(); as it used to be a few months ago with both demo ads and our provider ads. It looks like video pre-caching is disabled, although we didn't change anything on our side.

  Will test timeout value later today an let you know if it changes anything.

Igor

unread,
Feb 14, 2022, 7:46:10 AM2/14/22
to Interactive Media Ads SDK
Hi Michael.

  increasing timeout to 10 seconds helps to get rid of timeout error. Now we see the ads every time we show them.

  Please, note that timeout didn't change the black screen period between ad play start and actual ad video visible on the screen. We still experience 3 sec delay. This is a bit confusing: we've increased the timeout but delay wasn't changed. If this timeout influences preloading, we would expect to get the error before SDK report preload is finished. If this influences events after adManager.start() why video start (after precaching) is around 3 seconds with both default an 10 sec timeouts?

  Are there any ideas what could possibly go wrong?

Igor

unread,
Feb 15, 2022, 6:25:45 AM2/15/22
to Interactive Media Ads SDK
Hi MIchael.

  I've used video suite inspector to test our ad provider ads and got the following results:
1. The original ("old") suite inspector behaves correctly. We see no delay. The ad starts in the browser immediately after I press "test ad" button. This perfectly matches the behavior we had in our application early December.
2. The latest ("new") suite inspector shows timeout errors and has significant delay playing the ad. This perfrectly matches the behavior of our application today.

It seems that you've change something on your side which leads to this behavior. And this change influences the old version of SDK.

Could you provide me a private way to send you the test links so that you can see this for yourself?

IMA SDK

unread,
Feb 16, 2022, 2:39:57 AM2/16/22
to ig...@wildspike.com, ima...@googlegroups.com

Hello Igor,

 

Thank you for providing your own observations.

 

Please follow the process below in sharing files.

 

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

 

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=IMA+SDK&entry.460850823=5004Q00002WvEf5QAF&entry.80707362=00094099

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

 

Kindly include also the sample project implementation you used for testing, VAST Ad Tag and the screen recording of the behavior with steps to reproduce it for better illustration of the issue.

 

If you opt to share it on this thread, please use the "Reply To Author" button to send it privately. Otherwise, use the link mentioned above.

Regards,

Igor

unread,
Mar 9, 2022, 6:01:21 AM3/9/22
to Interactive Media Ads SDK
Hey guys.

  Haven't herard from you so far. Did you have a chance to have a look at our sample application?

IMA SDK

unread,
Mar 9, 2022, 3:39:25 PM3/9/22
to ig...@wildspike.com, ima...@googlegroups.com
Hello Igor,

This is Jackson, from the IMA SDK DevRel team. Sorry for the delay in replying to your issue.

Looking at the sample app you shared, it would seem that preloading is not properly being handled. I would recommend looking at the Android preloading guide for farther guidance. I believe your app needs to implement a queue for media items.

I had also not seen the an instance of the 'imawrapper' internal dependency used in your app. Did not seem to be the cause of the issue, but was curious why that was implemented in that way. 

It may be a change to your current app, but I would also like to recommend the ExoPlayer-IMA extension. This extension allows for a quick player implantation with IMA already included. It also has preloading enabled by default. You can see the IMA getting started guide and BasicExample for more details on the extension.

Please let me know if you have any questions.

Thank you,
Jackson
IMA SDK team

ref:_00D1U1174p._5004Q2WvEf5:ref

Igor Lobanchikov

unread,
Mar 10, 2022, 5:38:20 AM3/10/22
to IMA SDK, ima...@googlegroups.com
Hi Jackson.

  please, see below.

Regards,
Igor.


On Wed, Mar 9, 2022 at 11:39 PM IMA SDK <ima...@forumsupport.google> wrote:
Hello Igor,

This is Jackson, from the IMA SDK DevRel team. Sorry for the delay in replying to your issue.

Looking at the sample app you shared, it would seem that preloading is not properly being handled. I would recommend looking at the Android preloading guide for farther guidance. I believe your app needs to implement a queue for media items.
Well. We are aware of using a queue. However, we do not support ads with multiple videos in the list. We do support only single-ad cases and have a single media item. Do you think we still need to implement the media items queue? It seems to me that for the single video case this won't change anything.

I had also not seen the an instance of the 'imawrapper' internal dependency used in your app. Did not seem to be the cause of the issue, but was curious why that was implemented in that way. 
Sample project has 2 modules each having its own gradle.build. Just look into the imawrapper submodule.

It may be a change to your current app, but I would also like to recommend the ExoPlayer-IMA extension. This extension allows for a quick player implantation with IMA already included. It also has preloading enabled by default. You can see the IMA getting started guide and BasicExample for more details on the extension.
We've considered  this but Exoplayer requires us to have the main video. We are a game studio and obviously don't have our own video content. We need to pre-cache a video ad when the user plays the game. Than seamlessly show the ad without wait times for ad loading, then continue the game.

IMA SDK

unread,
Mar 10, 2022, 11:46:03 AM3/10/22
to ig...@wildspike.com, ima...@googlegroups.com
Hello Igor,

If you are only requesting a single ad preroll, I do not think enabling preloading will change the load times for users. Preloading is most useful in cases of multiple ads, such as cases of VMAP or ad pod ads.

For single prerolls, I would recommend using setVastLoadTimeout to update the time IMA waits for an ad response.

Let me know if you have any additional questions.

Igor Lobanchikov

unread,
Mar 11, 2022, 5:40:14 AM3/11/22
to IMA SDK, ima...@googlegroups.com
Hi Jackson.

    Could you, please, confirm, that the following won't preload ad video,

1. start video ad preloading
2. don't start a video ad until we get the reply that preload is finished
3. play normally (for at least, let say 30 seconds)
4. start precached video ad

  It is not quite clear, what's going on on your end, but I would expect precaching would not only precache VAST data, but will also precache some video either. In fact it did in December -- I do remember that with precaching video ad of our ad provider started immediately after precaching and now it waits for 4+ seconds.

Regards,
Igor.

IMA SDK

unread,
Mar 14, 2022, 11:54:03 AM3/14/22
to ig...@wildspike.com, ima...@googlegroups.com
Hello Igor,

Based on the Android preloading timing section, to maximize the effect of preloading in your use-case the following needs to occur to start preloading the ad:

- Call to 'AdsLoader.requestAds()' to request the ad.
- Call to 'AdsManager.init()' to begin preloading the ad preroll.

Once those two calls have been made, and time as been allowed to load the ad, you can call 'AdsManager.start()' and the ad should play immediately.

I am unsure what may have changed on our end to cause a delay in loading ads in your app. However, based on the previous instructions, does that give you and your team next steps to debug or fix the issue?

Igor Lobanchikov

unread,
Mar 22, 2022, 11:34:18 AM3/22/22
to IMA SDK, ima...@googlegroups.com
Hi Jackson.

- Call to 'AdsLoader.requestAds()' to request the ad.
- Call to 'AdsManager.init()' to begin preloading the ad preroll.
  I confirm that we do this. And we wait for all the callbacks we have to. I also confirm that after the calls are made we wait for a long enough time before triggering the AdsManager.start(). Here we waited for at least 30 seconds, but we still experience a delay.

  The tech sample I've sent you starts the video immediately, but this could be easily changed via runnable and you can put any delay.

  In fact we've provided the demo so that you could have a chance to look into your library and tell us what's going on. Please, let us know if you need more details or we can do other experiments..

Regards,
Igor.

IMA SDK

unread,
Mar 23, 2022, 11:44:39 AM3/23/22
to ig...@wildspike.com, ima...@googlegroups.com
Hello Igor,

I made some changes to the sample to highlight how I think IMA preloading is working as intended.

I captured the VAST tag, to remove any issues with that load call which seemed to fail request ads or load sometimes:
https://vastsynthesizer.appspot.com/jsui-and-preload

I updated the 'playAds()' method with a timeout so preloaded ads load from 'adManager.init()' before 'adsManager.play()' is called:
public void playAds() {
    if (adsManager!=null) {
      new android.os.Handler(Looper.getMainLooper()).postDelayed(
        new Runnable() {
          public void run() {
            adsManager.start();
            Log.i("IMA-test", "adsManager.start");
          }
        },
        3000); // Runs 3 seconds later.
    }
  }


With these changes I see the loading wheel appear after 'adsManager.init()' then the ad starts milliseconds after 'adsManager.start()' is called. Please see the screen recording. Let me know if you have questions, but as far as I can tell this is working as intended.
Screen Recording 2022-03-23 at 11_30_05 AM_mov.html
Reply all
Reply to author
Forward
0 new messages