SsaiApi

Provides hooks for server-side ad insertion integrations.

Accessible through Player.ssai. Vendor adapters can use this API to expose stitched ad periods as regular player ad state without relying on player internals.

Unless stated otherwise, mutating and lifecycle calls have no effect and emit an incorrect API usage warning when there is no active playback session. Call these APIs after loading a source with Player.load.

Functions

Link copied to clipboard
abstract fun clearAdBreaks()

Clears all SSAI ad state and removes all known SSAI ad breaks from Player.ads schedule.

Link copied to clipboard
abstract fun finishAd()

Finishes the currently active individual SSAI ad.

Link copied to clipboard
abstract fun finishAdBreak()

Finishes the currently active SSAI ad break.

Link copied to clipboard
abstract fun registerAdBreak(adBreak: SsaiAdBreak): SsaiAdBreak

Adds or replaces an SSAI ad break and exposes it through Player.ads schedule.

Link copied to clipboard
abstract fun registerAdBreaks(adBreaks: List<SsaiAdBreak>)

Adds or replaces multiple SSAI ad breaks and exposes them through Player.ads schedule.

Link copied to clipboard
abstract fun removeAdBreak(adBreak: SsaiAdBreak)

Removes a previously registered SSAI ad break with the same SsaiAdBreak.id as adBreak from Player.ads schedule.

Link copied to clipboard
abstract fun reportAdError(message: String, code: Int)

Reports a non-fatal SSAI ad error.

Link copied to clipboard
abstract fun reportAdQuartile(quartile: AdQuartile)

Reports an SSAI ad quartile.

Link copied to clipboard
abstract fun reportFatalError(message: String, code: PlayerErrorCode = PlayerErrorCode.General)

Reports a fatal SSAI error through the player error event flow.

Link copied to clipboard
abstract fun startAd(ad: SsaiAd)

Starts an individual SSAI ad inside the active ad break.

Link copied to clipboard
abstract fun startAdBreak(adBreak: SsaiAdBreak)

Starts treating playback as an SSAI ad break.