Learn the SDK architecture

  • The IMA DAI SDK facilitates communication between your video player and an ad server (like Google Ad Manager 360) to seamlessly integrate ads into video content.

  • The SDK handles requesting the video stream, parsing ad breaks, and delivering the content to the player for playback.

  • It manages the entire ad lifecycle, including displaying ads, tracking impressions, and handling potential errors, ensuring smooth ad integration and delivery.

  • Developers need to integrate the IMA DAI SDK into their web page or app, and the SDK will handle the complexities of ad interactions.

Select platform: HTML5 Android

This guide provides an overview of the SDK lifecycle and the interactions between your video stream player, the IMA DAI SDK, and an ad server.

Basic interactions

The following diagram illustrates and annotates the interactions between your video player, the IMA DAI SDK, and Ad Manager 360.

  1. The web page or app loads the IMA DAI SDK via:

    • an embedded script tag for HTML5
    • a native app for Android, Google Cast, iOS, tvOS, or Roku
  2. The IMA DAI SDK requests either a VOD stream or live stream from Google Ad Manager 360.

  3. Ad Manager 360 responds with the video stream that includes inserted ad breaks.

  4. The IMA DAI SDK parses the response, determines the correct media type based on environment, and delivers the video stream (and companion ads if needed) to the web page or app.

  5. The video player negotiates the playback details with the IMA DAI SDK and plays the ads.

  6. The IMA SDK fires an impression ping and tracking events, as needed.

Lifecycle

This diagram shows the full lifecycle of the IMA DAI SDK. Constructor and method calls are highlighted in blue, events are highlighted in red, and error conditions are shown with red connectors and red text.