Reducing latency
The key to reducing latency in your IMA-enabled app is to do as much
IMA-related set up as early as possible. You can do all of the following in your
app as early as you like before playing ads:
- Define your content playhead tracker
- Create your
AdDisplayContainer
- Create your
ImaSdkFactory
- Create your
AdsLoader
- Create your
AdsManager
- 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 your user even clicks play on your video. When you're
ready to play the ads, call AdsManager.init()
and wait for the
LOADED
event to play ads.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-02-07 UTC.
[null,null,["Last updated 2025-02-07 UTC."],[[["Reduce latency in IMA-enabled apps by completing IMA setup processes as early as possible before ad playback."],["Pre-initialization tasks include defining the playhead tracker, creating necessary IMA objects (AdDisplayContainer, ImaSdkFactory, AdsLoader, AdsManager), requesting ads, and registering event handlers."],["This approach allows the IMA SDK to initialize and process ads before user interaction, minimizing delays during playback."],["To start ad playback, call `AdsManager.init()` and wait for the `LOADED` event."]]],[]]