THEOplayerAdapter
THEOplayer implementation of the portable PlayerAdapter (PLAYG-398).
Wraps a Player the integrator owns — a plain THEOplayerView.player, or the native player resolved from a react-native-theoplayer view by the RN bridge — so the SDK drives THEOplayer-based content exactly like it drives Media3 through ExoPlayerAdapter. The adapter never owns the player: destroy detaches listeners and nothing else.
Thread safety
THEOplayer is main-thread-affine: its API must be called on the Android main thread. The SDK reads currentTime from whatever thread drives the scheduler ticker (Dispatchers.Default by default), so — like ExoPlayerAdapter — this adapter is safe from ANY thread:
Reads are served from a
@Volatilesnapshot refreshed ON the main thread, after every player callback and on a periodic poll (the playhead advances between callbacks).Commands run inline when already on the main thread and are posted to it otherwise.
Timed metadata
In-stream markers (HLS ID3 / EXT-X-DATERANGE / DASH emsg) arrive as cues on THEOplayer text tracks of kind metadata; the adapter subscribes to every such track as it appears and forwards each new cue as a TIMEDMETADATA event with a portable TimedMetadataCue payload (the Anvato signal path for ptsSource = ANVATO_CUE).
Properties
PlayerAdapter.currentTime from the main-thread snapshot, in seconds.
PlayerAdapter.duration from the snapshot, in seconds.
PlayerAdapter.isLive from the snapshot: whether THEOplayer reports an infinite duration.
PlayerAdapter.muted: reads the snapshot, writes on the main thread.
PlayerAdapter.paused from the snapshot.
Playback rate, read from the ENGINE rather than echoed from the last write.
PlayerAdapter.programDateTime: the stream's program date time at the current position, in milliseconds since the Unix epoch; null without one.
PlayerAdapter.volume (0.0 to 1.0): reads the snapshot, writes on the main thread.
Functions
ContentVideoSizeProvider: lets the renderer confine break layouts to the video.
PlayerAdapter.destroy: removes the THEOplayer listeners; the player itself is left to the app.
PlayerAdapter.load: sets url as the THEOplayer source on the main thread.
PlayerAdapter.off: removes a handler added with on.
PlayerAdapter.on: subscribes handler to event.
PlayerAdapter.pause on the main thread.
PlayerAdapter.play on the main thread.
PlayerAdapter.seek to time seconds on the main thread.
Pin the cheapest rendition by assigning a single VideoQuality to targetQuality, which both selects it and disables ABR for the track.