Warning: The IMA SDK for Cast SDK v2 has been officially deprecated, as of November 17th, 2021. All existing users are urged to migrate to CAF native Ad Breaks.

Reducing latency

Stay organized with collections Save and categorize content based on your preferences.

The key to reducing latency in your IMA-enabled app is to do as much IMA-related setup as early as possible. You can do all of the following on your web page as early as you like before playing ads:

  • Create your AdDisplayContainer.
  • Create your AdsLoader.
  • Create your AdsRequest.
  • Request ads.
  • Obtain your AdsManager instance and register event handlers.
Doing all of the above initializes the IMA SDK and request and parse your ads response all before the user even clicks play on your video. When you're ready to play the ads, call AdDisplayContainer.initialize() (always as the result of a user action!), then call AdsManager.init and AdsManager.start. For more information on making your entire page more responsive, see the tips on evaluating network performance in the Chrome documentation.