WebView: shared flow
On Android, Android TV, and iOS, the app opens the SDK page in a WebView. The flow is the same on all three platforms; only the way you receive events and your player code differ. Platform-specific details are on the Android, Android TV, and iOS pages.
Page address
https://cdn.adsdk.ru/android/v3/?url=https%3A%2F%2Fads.example.com%2Fvast.xml&lang=ru&controls=%5B%22ad-skip-btn%22%5DThe platform and the version are part of the path; playback settings are parameters. The same files are also served at https://adsdk.ru/sdk/… — for example https://adsdk.ru/sdk/android/v3/.
Platform
| Path | Platform |
|---|---|
/android/ | Android phones and tablets |
/androidtv/ | Android TV |
/ios/ | iPhone, iPad |
/web/ | The browser package, see Browser |
Version
| Channel | Example | What you get | Use it for |
|---|---|---|---|
| Major | v3 | Every 3.x fix and feature, never a breaking change | Recommended for production |
| Exact version | v3.0.0 | This build exactly; it never changes | Full control over updates |
latest | latest | The newest release, majors included | Debugging only: the next major release breaks your integration |
Moving to the next major version (v4) is a deliberate upgrade: read “Before you upgrade” in the releases first. The SDK always reports its exact version to the ad server through , even when a channel is loaded.
Parameters
| Parameter | Required | Description |
|---|---|---|
url | ✅ | VAST tag, encoded with encodeURIComponent. |
lang, controls, autoplay, … | See Parameters. | |
| Anything else | Appended to the VAST URL unchanged — a way to pass macros to the ad server. |
Who plays the video
The main mode is the app player. The ad runs through the same player as your content: with hardware decoding, the same quality, and no re-buffering inside the WebView.
Playback flow
What the app does
| When | What to call |
|---|---|
AdLoaded arrives | Load the video file address into your player. |
| The player starts playing | playAd() |
| Every player position update (~4 times a second) | timeupdateAd(position, duration) in seconds |
| The user paused / resumed | pauseAd() / playAd() |
| The ad ended | timeupdateAd(duration, duration) |
AdSkipped or AdError arrives | Stop the player. |
AdClick arrives | Open url in the browser. |
AdDestroyed arrives with ad_is_last = true | Close the WebView, return to the content. |
App and SDK connection
- Methods are called by executing JavaScript in the WebView:
window.myAdController.<method>(...). See the list under Methods. - Events on Android arrive as calls to methods of the
AndroidJavaScript interface; on iOS, as messages to theAdEventsHandlerhandler. See the list and formats under Events.
Transparent WebView
The SDK page is transparent. Make the WebView itself transparent too, or the ad won't be visible: Android — setBackgroundColor(Color.TRANSPARENT), iOS — isOpaque = false and backgroundColor = .clear.
Page opened inside a frame
window.myAdController is created in the window of the SDK page. If the WebView loads it inside an iframe, access the controller through window.top.myAdController.