Example directory in the SDK repo is a small SwiftUI app with a real AVPlayer: 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/Example/PlayerScreen.swift.
Clone and run
The project file is generated with XcodeGen:Example scheme on a simulator or device.
Point it at your account
The example runs against Kontext’s ad server with a demo token. InExample/Example/ExampleApp.swift, 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.