How the SDK works
What it consists of
The SDK is a web page (for apps) or a script (for websites). Inside, it has four parts:
- VAST player loads the tag, follows wrapper chains, selects the video file, and sends tracking to the ad system: impression, quartiles, clicks, errors.
- UI draws elements on top of the creative: the skip button, the click-through link, and labeling.
- Controller — the object your code uses to control playback.
- Events tell your code about every step. The delivery method depends on the platform.
Who's responsible for what
In apps, the work is split: the SDK knows everything about the ad, while your player plays the video. This way the ad runs through the same player as your content — with the same quality and hardware decoding.
| Task | SDK | Your app |
|---|---|---|
| Load the VAST, follow wrapper chains | ✅ | |
| Select the video file | ✅ | |
| Play the video | VPAID, browser | ✅ |
| Report playback time | ✅ timeupdateAd() | |
| Track quartiles and the skip point | ✅ | |
| Send tracking to the ad system | ✅ | |
| Draw buttons and labeling | ✅ | |
Open the advertiser's site on AdClick | ✅ | |
| Close the ad and return to the content | ✅ |
What it looks like on screen
The SDK page is transparent and sits on top of the app player. The user sees one screen:
SDKAd UIThe “Skip” and “Learn more” buttons, ERID labeling
WebViewSDK pageTransparent background — the ad shows through it
AppVideo playerPlays the ad at the address from AdLoaded
Layers
The WebView is the top layer: it receives taps on the SDK buttons. The app player sits below it. Make the WebView background transparent, or the ad won't be visible.
How playback happens
For the detailed event order, ad pods, and skipping, see Ad lifecycle.
Two builds
| Native | Web | |
|---|---|---|
| Who it's for | Android, Android TV, iOS | Websites |
| What it is | A page opened in a WebView | The ad-sdk.js script and styles |
| Starts | On its own, from parameters in the address | window.adSDK.init() |
| Controller | window.myAdController | controller.loader |
| Events | window.Android / AdEventsHandler | loader.on() |
| Video | App player | SDK |