SessionConfig

data class SessionConfig(val manifestUrl: String, val assetParameters: Map<String, String> = emptyMap(), val assetParameterMacros: Map<String, () -> String?> = emptyMap(), val assetParameterMacroValues: Map<String, AssetParameterMacro> = emptyMap(), val adInsertionType: AdInsertionType? = null)

Per-session configuration passed to OptiViewAds.startSession. Changes per piece of content / channel switch.

Constructors

Link copied to clipboard
constructor(manifestUrl: String, assetParameters: Map<String, String> = emptyMap(), assetParameterMacros: Map<String, () -> String?> = emptyMap(), assetParameterMacroValues: Map<String, AssetParameterMacro> = emptyMap(), adInsertionType: AdInsertionType? = null)

Properties

Link copied to clipboard

How this session's breaks relate to the content timeline, which decides where content resumes after a break: com.dolby.optiview.ads.core.AdInsertionType.REPLACEMENT (DAR) skips the replaced window; com.dolby.optiview.ads.core.AdInsertionType.INSERTION (DAI) resumes at the cue. When null, the manifest's resumeOffset drives the portable resolveResumePoint.

Link copied to clipboard

Customer macros for the $ tokens in asset-parameter values. Keys are the $-prefixed names as they appear in the break manifest; each callback is invoked when an ad request is built and its result replaces every occurrence of the name inside a value, so "\$OPTIVIEW_PLAYER_WIDTH\$x\$OPTIVIEW_PLAYER_HEIGHT\$" becomes "1920x1080". A fixed value is a constant callback: mapOf("\$SEGMENT\$" to { "sports" }); returning null leaves the macro unresolved. Use assetParameterMacroValues when an empty value should omit the parameter that contains the macro.

Link copied to clipboard

Macro callbacks with explicit AssetParameterMacroValue.Text, AssetParameterMacroValue.Empty, and AssetParameterMacroValue.Unresolved states. Uses the same $-prefixed names as assetParameterMacros. When a name is in both maps, this map wins.

Link copied to clipboard

Ad parameters for the assets played in this session — targeting, custom params, anything the ad server keys on.

Link copied to clipboard

Full URL of the break manifest for this content. Fetched and polled exactly as given — the SDK never composes, rewrites or appends to it, so the URL structure is entirely the backend's to decide.