Skip to main content
The example directory in the SDK repo is a small Android app with a real ExoPlayer: a home screen with four videos, one per ad format (the pause ad as a card and full screen), and a full-screen player that shows that video’s ad. The whole integration is one file, example/src/main/kotlin/so/kontext/video/example/PlayerActivity.kt.

Clone and run

You need JDK 17, the Android SDK with platform 35, and an emulator or device on Android 7.0 or later:
Or open the project in Android Studio and run the example module. Give an emulator 4 GB of memory or more: the player and the ad’s WebView run at once.

Point it at your account

The example runs against Kontext’s ad server with a demo token. In example/src/main/kotlin/so/kontext/video/example/ExampleApp.kt, put your own token into the Configuration:

What you should see

Open a video: the clip plays full screen and the SDK prepares that video’s ad.
  • Pause card: tap to pause, and the pause card appears; tap again to resume. A fresh ad is ready for the next pause.
  • Full-screen pause: tap to pause, and the ad covers the player; its Resume button resumes the content.
  • Overlay: after three seconds of playing, a strip appears over the player and goes away by itself; pausing ends it at once.
  • Linear: after three seconds of playing, the content pauses and the full-screen ad plays; the content resumes when it ends.
The line above the title shows the ad’s price once it is ready, then the last listener callback. Leaving the screen ends the video’s ads. adb logcat -s KontextVideo shows the SDK’s log.