SDK Architecture

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

Basic interactions

The following diagram illustrates and annotates the interactions among your video player, the IMA SDK v3, and an ad server. The ad server may be using Ad Manager, AdSense for Video (AFV), or Ad Exchange (AdX). The diagram helps you visualize how things will work when you finish implementing your integration with the SDK.

  1. The web page loads the IMA SDK via

    • an embedded script tag for HTML5
    • along with the app for Android, Google Cast, iOS, and tvOS.
  2. The IMA SDK requests a VAST Response for the specific Ad Unit on the ad server. The ad server called, either Ad Manager vs AFV/AdX, is determined by the ad tag URL.

  3. The ad server selects the best ad and sends a VAST response to the IMA SDK.

    • Ad Manager Ad Unit filters Line Item candidates
    • AdSense/Ad Exchange runs an auction
  4. The IMA SDK parses the VAST response, determines the correct media type based on environment, and delivers the in-line video creative (and companion ads if needed) to the web page.

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

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

Lifecycle

This diagram shows the full lifecycle of the IMA 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. Use this as a reference as you work through your IMA implementation.