Skip to content

Ad lifecycle

Playback states

Every playback ends with the AdDestroyed event — however it ends.

Single ad

Events over time

Example for a 20-second ad that becomes skippable after 5 seconds:

0 s5 s10 s15 s20 s
  1. AdStarted0 s · playAd()
  2. AdFirstQuartile5 s · 25 %
  3. AdSkippableStateChanged5 s · skipoffset 5 s
  4. AdMidpoint10 s · 50 %
  5. AdThirdQuartile15 s · 75 %
  6. AdComplete20 s · 100 %

How the SDK knows the time

In apps, the SDK calculates quartiles and the skip point from timeupdateAd() calls. Without them, no events will follow AdStarted. In the browser, and for VPAID, the SDK tracks the time itself.

Ad pod

If the VAST contains multiple ads, the SDK shows them one after another. Each ad goes through its own cycle from AdLoaded to AdDestroyed.

EventHow many times
AdStartedOnce per pod
AdLoaded, AdCreativeStarted, quartiles, AdComplete, AdDestroyedFor each ad
AdPodCompletedOnce, after the last ad
AdsEndedOnce, at the end of all ads (browser only)

ad_number is the ad's position in the pod, starting at 1. For a single-ad response, ad_number is -1.

Skipping

The skip time comes from the VAST (skipoffset). If an ad doesn't have one, it can't be skipped and the button doesn't appear.

Ad click

The SDK doesn't open the link itself: the app does, on the AdClick event. getAdCloseAct() tells you how to behave after the click-through — close the ad or pause it.

Errors

Error codes are listed under Errors.

When to close the ad

In an app, close the WebView; in the browser, call controller.destroy().