THEOplayer Web SDK
    Preparing search index...

    Interface ContentPlayerExperimental

    Playback state and controls for the content, independent of linear ad playback.

    These controls always act directly on the content player and bypass the ad player.

    Mutating members throw while the content video element is used for linear ad playback, or after the integration is destroyed.

    interface ContentPlayer {
        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;
        pause(): void;
        play(): 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 content position, in seconds.

    Setting this seeks the content to the requested position, clamped to ReadonlyContentPlayer.seekable. The write is a no-op when the content has no seekable range.

    Error If the content video element is used for linear ad playback, or the integration has been destroyed.

    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. This changes the content only.

    At break end, the viewer's mute state is copied back to the content, unless StartLinearAdBreakOptions.audio is 'content', in which case the viewer's mute control already applies to the content.

    Error If the content video element is used for linear ad playback, or the integration has been destroyed.

    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. This changes the content only.

    At break end, the viewer's volume is copied back to the content, unless StartLinearAdBreakOptions.audio is 'content', in which case the viewer's volume control already applies to the content.

    Error If the content video element is used for linear ad playback, or the integration has been destroyed.

    • Experimental

      Pause content playback directly, without affecting ad playback.

      Returns void

      Error If the content video element is used for linear ad playback, or the integration has been destroyed.

    • Experimental

      Start or resume content playback directly, without affecting ad playback.

      Returns void

      Error If the content video element is used for linear ad playback, or the integration has been destroyed.