Interface GoogleDAI

The Google DAI API.


- Available since v3.7.0.

interface GoogleDAI {
    snapback: boolean;
    sourceTransformer: ((url) => string | Promise<string>);
    contentTimeForStreamTime(time): number;
    replaceAdTagParameters(adTagParameters?): void;
    streamTimeForContentTime(time): number;


snapback: 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.

sourceTransformer: ((url) => string | Promise<string>)

A source transformer which will receive the source as returned from Google DAI before loading it in the player. This capability can be useful if you need to add authentication tokens or signatures to the source URL as returned by Google.

Type declaration

    • (url): string | Promise<string>
    • Parameters

      • url: string

      Returns string | Promise<string>


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


    • time: number

      The stream time with inserted ads (in seconds).

    Returns number

  • Replaces all the ad tag parameters used for upcoming ad requests for a live stream.


    • Optional adTagParameters: Record<string, string>

      The new ad tag parameters.

    Returns void

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


    • time: number

      The content time without any ads (in seconds).

    Returns number