OGPlayer
The ogplayer playback engine.
Create instances with OGPlayer.Builder. All methods must be called from the application main thread. Call release when done.
Types
Properties
Content positions of upcoming (unplayed) ad breaks in milliseconds — the cue markers a scrub bar renders. Postrolls report the content duration. Empty when no ad schedule is loaded.
Audio tracks (languages/audio descriptions) of the current media.
Buffered position in the current media, in milliseconds.
The cast connector this player was built with, if any.
Friendly name of the connected cast device, null when not connected.
The currently loaded media item, if any.
Current playback position in milliseconds.
Duration of the current media in milliseconds, or 0 when unknown.
Whether the current media item has a trick-play thumbnail track.
True when a valid, unexpired license key bound to this app was set. SDK-internal: read by the UI to gate the unlicensed-build watermark.
Whether an ad is currently playing (content is paused underneath).
Current playback speed (1.0 = normal).
Amount applied by seekBackward, in milliseconds.
Amount applied by seekForward, in milliseconds.
Current high-level playback state.
Current caption rendering style.
Subtitle/caption tracks of the current media (embedded + sideloaded).
Video renditions of the current media, highest first.
How the volume slider behaves; see VolumeControlMode. Default VolumeControlMode.DEVICE — the hardware volume buttons move the slider.
Functions
Loads the trick-play thumbnail for positionMs, or null when the item has no thumbnail track or loading fails. Safe to call while scrubbing; sprite sheets are cached internally.
Seeks backward by the configured increment (default 10s).
Seeks forward by the configured increment (default 10s).
Seeks to positionMs within the current media.
Seeks to the live edge (or default position) of the current media.
Selects the audio track with the given AudioTrack.id.
Selects the text track with the given TextTrack.id, or disables subtitles when null.
Pins playback to the rendition with the given VideoQuality.id, or returns to adaptive selection (Auto) when null.
SDK-internal: the view group ads render into (set by OGPlayerView). Accepts a Media3 AdViewProvider or a plain ViewGroup.
Sets the playback speed; speed must be positive.
SDK-internal: the ViewGroup slot-ad providers render into (set by OGPlayerView). Distinct from setAdViewGroup, which feeds the Media3/IMA ad view path.
Sets the caption rendering style, applied immediately.