Interface ServerSideAdIntegrationController

A controller to be used by your ServerSideAdIntegrationHandler to update the state of your custom server-side ad integration.

interface ServerSideAdIntegrationController {
    adBreaks: readonly AdBreak[];
    ads: readonly Ad[];
    integration: CustomAdIntegrationKind;
    beginAd(ad): void;
    createAd(init, adBreak?): Ad;
    createAdBreak(init): AdBreak;
    endAd(ad): void;
    error(error): void;
    fatalError(error, code?): void;
    removeAd(ad): void;
    removeAdBreak(adBreak): void;
    removeAllAds(): void;
    skipAd(ad): void;
    updateAd(ad, init): void;
    updateAdBreak(adBreak, init): void;
    updateAdProgress(ad, progress): void;
}

Properties

adBreaks: readonly AdBreak[]

The scheduled ad breaks managed by this integration.

ads: readonly Ad[]

The scheduled ads managed by this integration.

The identifier for this integration, as it was passed to Ads.registerServerSideIntegration.

Methods

  • Create a new ad.

    Parameters

    • init: AdInit

      The initial properties to be set on the created ad.

    • Optional adBreak: AdBreak

      If given, appends the ad to the given existing AdBreak. Otherwise, appends the ad to a new or existing AdBreak with the configured AdInit.timeOffset.

    Returns Ad

    Remarks

  • End the given ad.

    Parameters

    Returns void

    Remarks

  • Fire an aderror event on the player.

    This does not stop playback.

    Parameters

    Returns void

  • Remove the given ad.

    Parameters

    Returns void

    Remarks

  • Skip the given ad.

    Parameters

    Returns void

    Remarks

  • Update the given ad.

    Parameters

    • ad: Ad

      The ad to be updated.

    • init: Partial<AdInit>

      The properties to be updated on the ad.

    Returns void

  • Update the given ad break.

    Parameters

    Returns void

  • Update the playback progression of the given ad.

    Parameters

    • ad: Ad

      The ad to be updated.

    • progress: number

      The playback progress, as a number between 0 (at the start of the ad) and 1 (at the end of the ad).

    Returns void

    Remarks

    Throws

    Error If the ad is not started.