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: Ad): void;
    createAd(init: AdInit, adBreak?: AdBreak): Ad;
    createAdBreak(init: AdBreakInit): AdBreak;
    endAd(ad: Ad): void;
    error(error: Error): void;
    fatalError(error: Error, code?: ErrorCode): void;
    removeAd(ad: Ad): void;
    removeAdBreak(adBreak: AdBreak): void;
    removeAllAds(): void;
    skipAd(ad: Ad): void;
    updateAd(ad: Ad, init: Partial<AdInit>): void;
    updateAdBreak(adBreak: AdBreak, init: Partial<AdBreakInit>): void;
    updateAdProgress(ad: Ad, progress: number): 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.

    • OptionaladBreak: 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

  • End the given ad.

    Parameters

    Returns void

  • Fire an aderror event on the player.

    This does not stop playback.

    Parameters

    Returns void

  • Remove the given ad.

    Parameters

    Returns void

  • Skip the given ad.

    Parameters

    Returns void

  • 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

    Error If the ad is not started.