THEOplayer Web SDK
    Preparing search index...

    Interface LinearAdPlaybackExperimental

    Playback state and controls for a linear ad in a client-side ad integration.

    The player reads these properties to report the ad playback state through its own API, and calls the methods when playback is controlled through the player. The integration must call ClientSideAdIntegrationController.updateLinearAdBreak whenever any of these properties change. Report playback errors with ClientSideAdIntegrationController.error for non-fatal aderror events or ClientSideAdIntegrationController.fatalError for fatal errors.

    ClientSideAdIntegrationController.linearAdPlayer implements this interface. A forwarding wrapper around it behaves identically when it forwards the built-in player's events to ClientSideAdIntegrationController.updateLinearAdBreak.

    interface LinearAdPlayback {
        currentTime: number;
        duration: number;
        ended: boolean;
        muted: boolean;
        paused: boolean;
        readyState: number;
        usesContentVideoElement?: boolean;
        videoHeight: number;
        videoWidth: number;
        volume: number;
        pause(): void;
        play(): void;
    }

    Hierarchy (View Summary)

    Index
    currentTime: number

    The current playback position of the linear ad (or ad break), in seconds.

    duration: number

    The duration of the linear ad (or ad break), in seconds, or NaN if unknown.

    ended: boolean

    Whether the linear ad or ad break has ended.

    The player reads this property when ClientSideAdIntegrationController.updateLinearAdBreak is called.

    muted: boolean

    Whether the linear ad is muted.

    Set when ChromelessPlayer.muted changes during linear ad playback.

    paused: boolean

    Whether the linear ad is paused.

    readyState: number

    The ready state of the linear ad, using the same values and meaning as ChromelessPlayer.readyState.

    A delegate backed by an HTMLMediaElement can forward its readyState.

    The player reads this property when ClientSideAdIntegrationController.updateLinearAdBreak is called.

    usesContentVideoElement?: boolean

    Whether this playback really renders the linear ad in ClientSideAdIntegrationController.contentVideoElement instead of ClientSideAdIntegrationController.adContainer.

    Set this to true only when this playback plays the ad in the content video element, so the player can hand over the element before the ad starts and restore the content afterwards. The player reads this property once, when ClientSideAdIntegrationController.startLinearAdBreak is called.

    false

    videoHeight: number

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

    The player reads this property when ClientSideAdIntegrationController.updateLinearAdBreak is called.

    videoWidth: number

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

    The player reads this property when ClientSideAdIntegrationController.updateLinearAdBreak is called.

    volume: number

    The volume of the linear ad, as a number between 0 and 1.

    Set when ChromelessPlayer.volume changes during linear ad playback.

    • Experimental

      Pause playback of the linear ad.

      Called by ChromelessPlayer.pause during linear ad playback.

      Returns void

    • Experimental

      Resume playback of the linear ad.

      Called by ChromelessPlayer.play during linear ad playback.

      Returns void