THEOplayer Web SDK
    Preparing search index...

    Interface ReadonlyContentPlayer

    The read-only playback state of a content player.

    For a server-side ad integration, this is the state of the stitched stream, which includes the ads. For a client-side ad integration, this is the state of the content only: it is not affected by linear ads from this or any other integration. While a linear ad plays, the content stays paused at the position where it was interrupted, even if the ad is played in the same video element as the content.

    interface ReadonlyContentPlayer {
        currentProgramDateTime: Date | null;
        currentTime: number;
        duration: number;
        ended: boolean;
        error: THEOplayerError | undefined;
        muted: boolean;
        paused: boolean;
        playbackRate: number;
        readyState: number;
        seekable: TimeRanges;
        seeking: boolean;
        textTracks: TextTracksList;
        videoHeight: number;
        videoWidth: number;
        volume: number;
        addEventListener<TType extends keyof ReadonlyContentPlayerEventMap>(
            type: TType | readonly TType[],
            listener: EventListener<ReadonlyContentPlayerEventMap[TType]>,
        ): void;
        removeEventListener<TType extends keyof ReadonlyContentPlayerEventMap>(
            type: TType | readonly TType[],
            listener: EventListener<ReadonlyContentPlayerEventMap[TType]>,
        ): void;
    }

    Hierarchy (View Summary)

    Index
    currentProgramDateTime: Date | null

    The current playback position of the content, as a timestamp, or null if the content does not have program date time information.

    currentTime: number

    The current playback position of the content, in seconds.

    duration: number

    The duration of the content, in seconds, or NaN if unknown.

    ended: boolean

    Whether playback of the content has ended.

    error: THEOplayerError | undefined

    The current error of the content player, or undefined if there is no error.

    muted: boolean

    Whether the content audio is muted.

    paused: boolean

    Whether the content is paused.

    • During linear ad playback of a client-side ad integration, the content is always paused.
    playbackRate: number

    The playback rate of the content.

    readyState: number

    The ready state of the content player, using the same values as ChromelessPlayer.readyState.

    seekable: TimeRanges

    The ranges of the content that are seekable, in seconds.

    For a live stream, an integration can use this to choose a valid position.

    seeking: boolean

    Whether the content is seeking.

    textTracks: TextTracksList

    The text tracks of the content, including metadata tracks such as ID3, EMSG or date range tracks.

    • For a client-side ad integration, this list never contains text tracks of a linear ad, even if the ad is played by the built-in player.
    videoHeight: number

    The height of the content video, or 0 if unknown.

    videoWidth: number

    The width of the content video, or 0 if unknown.

    volume: number

    The content volume, as a number between 0 and 1.