The THEOplayer API.

interface THEOplayer {
    abr: undefined | ABRConfiguration;
    ads: AdsAPI;
    aspectRatio: AspectRatio;
    audioTracks: MediaTrack[];
    autoplay: boolean;
    backgroundAudioConfiguration: BackgroundAudioConfiguration;
    broadcast: EventBroadcastAPI;
    buffered: TimeRange[];
    cast: CastAPI;
    currentTime: number;
    duration: number;
    height: undefined | number;
    keepScreenOn: boolean;
    muted: boolean;
    nativeHandle: unknown;
    paused: boolean;
    pipConfiguration: PiPConfiguration;
    playbackRate: number;
    preload: PreloadType;
    presentationMode: PresentationMode;
    renderingTarget?: RenderingTarget;
    seekable: TimeRange[];
    seeking: boolean;
    selectedAudioTrack: undefined | number;
    selectedTextTrack: undefined | number;
    selectedVideoTrack: undefined | number;
    source: undefined | SourceDescription;
    targetVideoQuality: undefined | number | number[];
    textTrackStyle: TextTrackStyle;
    textTracks: TextTrack[];
    version: PlayerVersion;
    videoTracks: MediaTrack[];
    volume: number;
    width: undefined | number;
    addEventListener<TType>(type, listener): void;
    destroy(): void;
    pause(): void;
    play(): void;
    removeEventListener<TType>(type, listener): void;
}

Hierarchy (view full)

Properties

abr: undefined | ABRConfiguration

The player's adaptive bitrate (ABR) configuration.

ads: AdsAPI

The API for advertisements.

aspectRatio: AspectRatio

Used to set the aspect ratio of the player.

Remarks

Only available for iOS and Android.

audioTracks: MediaTrack[]

List of audio tracks of the current source.

autoplay: boolean

Whether the player should immediately start playback after source change.

backgroundAudioConfiguration: BackgroundAudioConfiguration

The active configuration for PiP.

Event Broadcast API.

buffered: TimeRange[]

Returns a list of TimeRanges that represents the ranges of the media resource that are buffered by the player.

cast: CastAPI

The API for casting devices.

currentTime: number

The current playback position of the media, in milliseconds.

duration: number

The duration of the media, in milliseconds.

height: undefined | number

The height of the player.

keepScreenOn: boolean

Toggle the wake-lock on the player view. The screen will time out if disabled.

Default Value

true

Remarks

Only available on Android.

muted: boolean

Determines whether audio is muted.

nativeHandle: unknown

Native player handle.

paused: boolean

Whether the player is paused.

pipConfiguration: PiPConfiguration

The active configuration for PiP.

playbackRate: number

Used to set the playback rate of the media.

Example

<br/> - `playbackRate = 0.70` will slow down the playback rate of the media by 30%.
<br/> - `playbackRate = 1.25` will speed up the playback rate of the media by 25%.

Remarks


- Playback rate is represented by a number where 1 is default playback speed.
- Playback rate must be a positive number.
- It is recommended that you limit the range to between 0.5 and 4.

preload: PreloadType

The preload setting of the player.

presentationMode: PresentationMode

The PresentationMode of the player. Can be switched to: picture-in-picture, fullscreen or inline

renderingTarget?: RenderingTarget

Specifies where the player is displaying the video.

Default Value

SURFACE_VIEW

Remarks

Only available for Android.

seekable: TimeRange[]

Returns a list of TimeRanges that represents the ranges of the media resource that are seekable by the player.

seeking: boolean

Whether the player is seeking.

selectedAudioTrack: undefined | number

Used to set the current selected audio track by passing its uid, or undefined to select none.

selectedTextTrack: undefined | number

Used to set the current selected text track by passing its uid, or undefined to select none.

selectedVideoTrack: undefined | number

Used to set the current selected video track by passing its uid, or undefined to select none.

source: undefined | SourceDescription

A source description that determines the current media resource.

targetVideoQuality: undefined | number | number[]

Used to set the current selected video quality by passing its uid, or undefined to select none.

textTrackStyle: TextTrackStyle

The text track style API.

Remarks

Only available for Web.

textTracks: TextTrack[]

List of text tracks of the current source.

version: PlayerVersion

The player version.

Deprecated

use sdkVersions instead.

videoTracks: MediaTrack[]

List of video tracks of the current source.

volume: number

Used to set the volume of the audio.

Remarks


- Volume is represented by a floating point number between 0.0 and 1.0.

width: undefined | number

The width of the player.

Methods