PlayerAdapter
The abstraction layer between the SDK and any content player — the Kotlin mirror of packages/core/src/interfaces/PlayerAdapter.ts.
The SDK core only interacts with players through this interface, so the brain stays player-agnostic and never imports Media3/ExoPlayer. The portable brain (BreakScheduler) reads only currentTime; the rest of the contract is used by the SDK orchestrator and the platform ad renderer.
Android idiom: unlike the web adapter (whose load/play return Promises), load/play are synchronous here — they kick off preparation/playback and return immediately; readiness/completion is signalled via PlayerAdapterEvents (e.g. playing, waiting, ended). There is also no web-only videoElement.
Properties
Current playback time in seconds.
Total content duration in seconds; Double.POSITIVE_INFINITY for live.
Optional hint: whether the loaded content is a LIVE (dynamic-timeline) stream. On live content duration is not a reliable signal on Android — ExoPlayer reports the (finite) sliding-window duration — so the runtime uses this to restore the viewer's live latency after a break that paused content, regardless of the channel's break timebase. Null means unknown and is treated as not live.
The furthest position on this player's timeline a seek will actually STICK on live content, in seconds — the engine pulls back anything closer to the live edge.
Playback rate, where 1.0 is normal speed. Optional, and settable.
False while play expresses intent but the content timeline is not yet ready for a startup seek.
Whether currentTime is measured from the START OF A SLIDING WINDOW rather than from a fixed origin.
Program Date Time from the stream (EXT-X-PROGRAM-DATE-TIME for HLS), as epoch milliseconds, used for wallclock-timebase break matching. Null when unavailable. (Epoch ms rather than a Date/Instant to keep the brain dependency-free and conformance-portable.)
End of the available media in seconds; null when unknown.
Start of the same seekable range as seekableEnd; null when unknown.
Optional capability hint: whether this adapter/platform can buffer a second media source in parallel with the content player without decoder contention. Null is treated as true by the auto preload resolver.
Declared HLS EXT-X-TARGETDURATION in seconds, not average segment length; null when unknown.
Functions
Unsubscribe a previously registered handler.
Subscribe to a player event.
Ask the engine to begin the upcoming live playback targetDurations declared target durations behind the live edge, before the first frame, instead of the SDK seeking after it. fallbackTargetDuration (seconds) applies when the engine cannot read the playlist's. null withdraws the request. Returns false when the engine cannot honour it for the upcoming start; the SDK then seeks after the first frame.
Optionally select a content quality, or pass null to release the SDK's override. A successful VideoQuality.LOWEST request snapshots the integrator's current selection and applies the cheapest rendition without flushing. Returns true only when the requested override was applied or restoration of an outstanding override was successfully attempted.