The Google DAI API.

interface GoogleDAI {
    snapback: Promise<boolean>;
    contentTimeForStreamTime(time): Promise<number>;
    setSnapback(enabled): void;
    streamTimeForContentTime(time): Promise<number>;
}

Properties

snapback: Promise<boolean>

Whether snapback is enabled. When enabled and the user seeks over multiple ad breaks, the last ad break that was seeked past will be played.

Default Value

true

Methods

  • Returns the content time without ads for a given stream time. Returns the given stream time for live streams.

    Parameters

    • time: number

      The stream time with inserted ads (in seconds).

    Returns Promise<number>

  • Set snapback value. When enabled and the user seeks over multiple ad breaks, the last ad break that was seeked past will be played.

    Parameters

    • enabled: boolean

    Returns void

  • Returns the stream time with ads for a given content time. Returns the given content time for live streams.

    Parameters

    • time: number

      The content time without any ads (in seconds).

    Returns Promise<number>