Package-level declarations
The Break Manifest model (BreakManifest, Break, Asset, BreakFormat, Timebase), the PlayerAdapter contract with its events and timed-metadata cues, the preload / insertion / delivery mode types, the exceptions the SDK throws, and the diagnostic category and level types.
Types
Why a polled Break Manifest counts as a switch to another ads channel. Carried on the adchannelchange event as its reason.
Ad insertion type — how an ad break relates to the content timeline. Mirrors the TS AdInsertionType ('replacement' = DAR, 'insertion' = DAI).
A single ad asset. Only the fields the SDK orchestrator/sequencer need are modeled here (the id drives the ad-event sequence); rich asset detail (uri/mediaType/companion/vendor params) is added in the player phase.
A customer macro: a zero-argument callback evaluated every time an ad request is built, registered per token name in SessionConfig.assetParameterMacros. Return AssetParameterMacroValue.of of a string for a constant.
What a macro resolves to when an ad request is built.
The supported break formats (mirrors the TS BreakFormat).
The root Break Manifest structure.
The only supported position value: a pre-roll relative to session start.
A break variant (format + ordered assets). The portable brain reads format/rawFormat/targeting/assets (variant selection — see selectVariantDetailed); the overlay layout fields (position/size/opacity) are resolved by the platform renderer and are populated only for BreakFormat.OVERLAY variants (null otherwise). Companion remains out of the portable model.
Pre-break warnings (OptiViewAdsConfig.breakWarnings): the SDK emits an adbreakstatus event with phase = upcoming at each threshold.
Consecutive-break chaining (OptiViewAdsConfig.chaining): when one break ends and the next starts within maxGapSeconds, the SDK plays the next break at once instead of resuming content for the gap.
Intrinsic pixel dimensions of the content video, as reported by the player.
Optional capability a PlayerAdapter can implement to report the content video's intrinsic dimensions.
Delivery architecture a DeliveryRule can select (mirrors the TS DeliveryMode).
One delivery-steering rule (mirrors the TS DeliveryRule). A rule without targeting matches every client (the manifest's default); a targeted rule matches only its device type.
Device class used for per-URI asset targeting (mirrors the TS DeviceType).
Functional area a diagnostic relates to.
Static metadata describing a diagnostic code.
Severity of a diagnostic record.
Which side keeps audio during a double-format break.
One IMA pod-ad report, normalized off AdEvent.getAd().getAdPodInfo() by the render layer so this module never sees an IMA object.
The GAM stream identity, as used to create the IMA/DAI session.
The vendorParameters of a GAM pod-serving asset, validated. The EABN version selects the pod URL path segment (/pod/ vs /ad_break_id/).
Resolved ad-insertion strategy: the auto sentinel resolves to one of these.
Interaction options for an asset (mirrors the TS Interaction).
Parses and validates break manifests. Mirrors the validation in packages/core/src/services/ManifestService.ts (parseManifest) — error messages are part of the cross-language contract and must match the TS reference byte-for-byte (the conformance harness diffs them).
A trusted Ed25519 verification key, resolved by the protected kid.
The built-in asset-parameter macros the SDK resolves itself. A customer macro registered under one of these names in SessionConfig.assetParameterMacros takes precedence over the built-in value.
Marks a declaration the SDK modules share with each other but that is not part of the supported public API: it can change or disappear in any release and is left out of the API reference. Using it from an app produces a compiler warning; opt in with @OptIn(OptiViewInternalApi::class) to accept that.
Position of an overlay ad within the player surface, as fractions 0.0-1.0 of the surface (mirrors the TS OverlayPosition). Only one of {top, bottom} and one of {left, right} is typically supplied; the renderer converts these to platform layout. Brain-agnostic — only the overlay renderer reads them.
Size of an overlay ad as fractions 0.0-1.0 of the player surface (mirrors the TS OverlaySize).
The resolved pause ad to display: the originating break, its single asset, how the asset is sourced, and whether it is an image or a video. The renderer uses source to decide whether to load the URL directly (static) or fetch + parse the VAST creative first (vast), and mediaType to decide whether to render an image overlay or a muted, play-once video. Mirrors the TS PauseAdResolution.
The abstraction layer between the SDK and any content player — the Kotlin mirror of packages/core/src/interfaces/PlayerAdapter.ts.
Event types a PlayerAdapter must forward (mirrors the TS PlayerAdapterEvent).
A player event handler. The optional payload carries adapter-specific detail (e.g. a media error or TimedMetadataCue).
Resolved preload strategy: the auto sentinel resolves to one of these.
Thrown when the manifest steers the session to ssai but no vendor configuration can provide a stitched stream. Deliberately catchable by the application (no silent fallback to sgai): the app decides which stream to play instead.
A single in-stream timed-metadata marker surfaced by a content player — the Kotlin mirror of the TS TimedMetadataCue. Carried as the payload of a TIMEDMETADATA event; in SSAI mode the SDK forwards it to the IMA DAI stream manager for ad tracking.
Tune-in, or join-in-progress (OptiViewAdsConfig.tuneIn): a viewer who joins while a break is already running sees the remainder of that break, unless less than minBreakDurationSeconds of it is left.
Inputs the platform layer feeds into a selection (mirrors the TS shape).
An ad playback error that carries the ad vendor's own error code (e.g. the numeric IMA/VAST AdError code), so telemetry can report it (adevc) alongside the SDK's taxonomy code. Vendor integrations wrap their errors in this type when the vendor supplies a code; errors without one stay plain exceptions.
Session-level configuration for one vendor integration.
A quality target understood by the optional PlayerAdapter.setVideoQuality operation.
Properties
Default for OptiViewAdsConfig.pdtGraceSeconds: how long a wallclock session waits for the stream's program date time.
The header carrying the detached JWS over the manifest response body.
Default Clock backed by the system clock.
Functions
The playback event that triggers brk (spec event or legacy position), or null for a timeline break.
Look up the metadata for a known diagnostic code, or null if unknown.
Seconds after content playback ends before a post-roll triggers, or null when brk is not a post-roll.
Pre-roll delay in seconds of played content, or null when brk is not a START pre-roll.
Whether a pre-roll fires as soon as content playback starts: a delay: 0 pre-roll with no adStartDelay (an ad-free start would swallow it).
True when start is an EventTrigger rather than a timebase position.
True when brk is a pause ad: its start is an EventTrigger for BreakEvent.PAUSE.
Whether the break is a post-roll: start: { type: 'event', event: 'end' }.
Resolve the declared ad format of a break — the first (selected) variant's BreakFormat (PLAYG-182), mirroring the TS resolveBreakFormat. Surfaced on the public break/ad events. Null when the break declares no variant.
Resolve this asset's URI for deviceType, handling both the single-string and the targeted-array manifest shapes. Prefer this over reading Asset.uri directly.