OptiView Ads SDK
The OptiView Ads SDK is the recommended way to integrate OptiView Ads into your application. It is player-agnostic: you bring your own player, and the SDK takes care of the OptiView Ads specifics:
- Break Manifest logic: the SDK polls the channel's Break Manifest and schedules the announced breaks against your player's timeline. You do not implement any polling or scheduling yourself.
- Ad playback: the SDK renders the scheduled ads, including the different break layouts, on top of your content player.
- Ad tracking and analytics: the SDK reports the ad impressions and tracking events for the ads it plays.
The SDK is available for Web, Android, iOS, and React Native.
How the SDK works with your player
The SDK never talks to your player directly. All player interaction goes through a small player adapter interface, which exposes the playback state the SDK needs — most importantly the stream's timing information (such as the EXT-X-PROGRAM-DATE-TIME position on a live HLS stream) that breaks are scheduled against. The SDK ships ready-made adapters for popular players on each platform, and you can implement the adapter interface yourself for any other player.
Configuration
Configuration is split into two levels:
- SDK configuration is provided once, when you create the SDK instance. It describes your player and how ads should be presented.
- Session configuration is provided per channel, when you start a monetization session. It identifies the channel to monetize.
SDK configuration
| Property | Description |
|---|---|
player | The adapter that wraps your content player. Required. |
container | The element or view in which the SDK renders ads, stacked above your content player. Required. |
mode | The ad insertion model: sgai (server-guided, the default) or ssai (server-side, for streams where the ads are stitched into the media stream). |
gam | Google Ad Manager configuration for Google Pod Serving: contains your networkCode. |
debug | Enables verbose logging during development. |
The SDK also exposes optional presentation settings — such as ad preloading, break chaining, and tune-in behavior — with sensible defaults. The platform pages describe the platform-specific options.
Session configuration
| Property | Description |
|---|---|
manifestUrl | The channel's Break Manifest URL. Required. See Retrieving the required values. |
customAssetKey | The Google Pod Serving custom asset key of the channel. Required to play Google Ad Manager breaks. See Google Pod Serving. |
assetParameters | Session-level ad parameters, merged with the break's assetParameters and forwarded to Google as adTagParameters. Use these for player-side values such as device identifiers. See Ad tag parameters. |
Retrieving the required values
- Break Manifest URL (
manifestUrl): every channel exposes its Break Manifest on a public endpoint. The URL follows the patternhttps://us.markers.optiview.dolby.com/manifest/v1/{orgId}/channels/{channelId}(replaceus.witheu.for the EU region), using your organization ID and the channel's ID. See the Break Manifest endpoint for details. - Google
networkCodeandcustomAssetKey: these come from your Google Ad Manager setup. See the Google Ad Manager prerequisites and Google Pod Serving.
Choose a platform
Web
On Web, the OptiView Ads SDK works with any HLS-capable player through a player adapter. Ready-made adapters are available for the OptiView Player (THEOplayer), HLS.js, Shaka Player, and the browser's native `` element, and you can implement a custom adapter for any other player.
Android
On Android and Android TV, the OptiView Ads SDK is a native Kotlin library that works with the OptiView Player (THEOplayer) and Media3 / ExoPlayer through player adapters, and with any other player through a custom adapter.
iOS
On iOS and tvOS, the OptiView Ads SDK is a native Swift library that works with the OptiView Player (THEOplayer) and AVPlayer through player adapters, and with any other player through a custom adapter.
React Native
On React Native, the OptiView Ads SDK bridges the native Android and iOS SDKs behind a typed JavaScript API. All timing-sensitive break scheduling runs natively, so playback stays smooth regardless of the JavaScript thread's load.
Related resources
| Resource | Description |
|---|---|
| Break Manifest | The contract between the OptiView Ads backend and the player. |
| Channels | The channel whose Break Manifest the SDK polls. |
| Breaks | The breaks the SDK schedules and plays. |
| Google Pod Serving | Google Ad Manager configuration for pod-served breaks. |