interface RestrictStrategy {
    shouldLoadAdBreak: ((toLoad) => boolean);
    shouldPlayAdBreak: ((toPlay) => boolean);
    shouldPlaySkippedAdBreaks: ((skipped, from, to) => AdBreak[]);
}

Properties

shouldLoadAdBreak: ((toLoad) => boolean)

A callback function that will be called every time an ad break is about to load. The return value decides whether the ad break will actually be loaded or discarded from the ad schedule.

Type declaration

    • (toLoad): boolean
    • Parameters

      Returns boolean

shouldPlayAdBreak: ((toPlay) => boolean)

A callback function that will be called every time an ad break is about to start. The return value decides whether the ad break will actually start playing or be discarded from the ad schedule.

Type declaration

    • (toPlay): boolean
    • Parameters

      Returns boolean

shouldPlaySkippedAdBreaks: ((skipped, from, to) => AdBreak[])

A callback function that will be called after every seek where ad breaks were scheduled in between the original time and the seek target. The return value decides which ad breaks will be played after the operation finished.

The default behaviour is to playback the most recent AdBreak.

Type declaration