Interface IOmapClient

Interface for OMAP client implementations

interface IOmapClient {
    attachAdInsertionDecider(filter): void;
    destroy(): void;
    hasAdPodInsertionAt(time): boolean;
    notifyAdCreativeEnded(adCreative, adSequence): void;
    notifyAdCreativePlaying(adCreative, elapsedTime, adSequence): void;
    notifyAdPlaybackError(ad): void;
    notifyAdPodEnded(): void;
    notifyAdPodSkipped(): void;
    notifyAdStarted(ad): void;
    notifyCurrentTime(currentTime): void;
    off(type, listener): void;
    off(type, listener): void;
    off(type, listener): void;
    off(type, listener): void;
    off(type, listener): void;
    off(type, listener): void;
    off(type, listener): void;
    off(type, listener): void;
    off(type, listener): void;
    off(type, listener): void;
    off(type, listener): void;
    on(type, listener): void;
    on(type, listener): void;
    on(type, listener): void;
    on(type, listener): void;
    on(type, listener): void;
    on(type, listener): void;
    on(type, listener): void;
    on(type, listener): void;
    on(type, listener): void;
    on(type, listener): void;
    on(type, listener): void;
    play(): void;
}

Methods

  • Will replace ad insertion decider.

    Parameters

    • filter: ((currentTime, adBreaks, countAdBreakConsumption) => undefined | default)

      the custom ad decider function

        • (currentTime, adBreaks, countAdBreakConsumption): undefined | default
        • Parameters

          • currentTime: number
          • adBreaks: default[]
          • countAdBreakConsumption: ((adBreak) => number)
              • (adBreak): number
              • Parameters

                • adBreak: default

                Returns number

          Returns undefined | default

    Returns void

  • Use the method to check if the client has ad pod insertion point at the time.

    Parameters

    • time: number

    Returns boolean

  • Use the method to notify the client that the playing ad has ended.

    Parameters

    • adCreative: AdCreative

      the ad creative that has ended

    • adSequence: number

      the ad sequence number in the ad pod

    Returns void

  • Use the method to notify the client the playing ad creative's playhead information.

    Parameters

    • adCreative: AdCreative

      the ad creative that is playing

    • elapsedTime: number

      the elapsed time in the ad creative

    • adSequence: number

      the ad sequence number in the ad pod

    Returns void

  • Use the method to notify the client that an error has occured while playing the ad creative.

    Parameters

    Returns void

  • Use the method to notify the client that the current ad pod has ended.

    Returns void

  • Use the method to notify the client that the current ad pod has been skipped.

    Returns void

  • Use the method to notify the client that the current ad has started.

    Parameters

    • ad: Ad

      the ad that has started

    Returns void

  • Use the method to notify the client the current time in seconds.

    Parameters

    • currentTime: number

      current time in seconds

    Returns void

  • Use the off method to remove listener for the CONTENT_CAN_PLAY event.

    Parameters

    • type: "contentCanPlay"

      the type of event : OmapClientEvent.CONTENT_CAN_PLAY

    • listener: (() => void)

      the listener function

        • (): void
        • Returns void

    Returns void

  • Use the off method to remove listener for the CONTENT_PAUSE_REQUESTED event.

    Parameters

    • type: "contentPauseRequested"

      the type of event : OmapClientEvent.CONTENT_PAUSE_REQUESTED

    • listener: (() => void)

      the listener function

        • (): void
        • Returns void

    Returns void

  • Use the off method to remove listener for the CONTENT_RESUME_REQUESTED event.

    Parameters

    • type: "contentResumeRequested"

      the type of event : OmapClientEvent.CONTENT_RESUME_REQUESTED

    • listener: (() => void)

      the listener function

        • (): void
        • Returns void

    Returns void

  • Use the off method to remove listener for the ALL_ADS_COMPLETED event.

    Parameters

    • type: "allAdsCompleted"

      the type of event : OmapClientEvent.ALL_ADS_COMPLETED

    • listener: (() => void)

      the listener function

        • (): void
        • Returns void

    Returns void

  • Use the off method to remove listener for the LOADED event.

    Parameters

    • type: "loaded"

      the type of event : OmapClientEvent.LOADED

    • listener: ((adBreaks) => void)

      the listener function

        • (adBreaks): void
        • Parameters

          Returns void

    Returns void

  • Use the off method to remove listener for the LOAD_ERROR event.

    Parameters

    • type: "load_error"

      the type of event : OmapClientEvent.LOAD_ERROR

    • listener: (() => void)

      the listener function

        • (): void
        • Returns void

    Returns void

  • Use the off method to remove listener for the STARTED event.

    Parameters

    • type: "started"

      the type of event : OmapClientEvent.STARTED

    • listener: (() => void)

      the listener function

        • (): void
        • Returns void

    Returns void

  • Use the off method to remove listener for the COMPLETE event.

    Parameters

    • type: "complete"

      the type of event : OmapClientEvent.COMPLETE

    • listener: (() => void)

      the listener function

        • (): void
        • Returns void

    Returns void

  • Use the off method to remove listener for the AD_POD_INSERTION_REQUESTED event.

    Parameters

    • type: "adPodInsertionRequested"

      the type of event : OmapClientEvent.AD_POD_INSERTION_REQUESTED

    • listener: ((adPodInsertionRequest) => void)

      the listener function

    Returns void

  • Use the off method to remove listener for the AD_POD_INSERTION_REQUEST_FAILED event.

    Parameters

    • type: "adPodInsertionRequestFailed"

      the type of event : OmapClientEvent.AD_POD_INSERTION_REQUEST_FAILED

    • listener: (() => void)

      the listener function

        • (): void
        • Returns void

    Returns void

  • Use the off method to remove listener for the AD_POD_PREPARATION_REQUESTED event.

    Parameters

    • type: "adPodPreparationRequested"

      the type of event : OmapClientEvent.AD_POD_PREPARATION_REQUESTED

    • listener: ((adPodInsertionRequest) => void)

      the listener function

    Returns void

  • Use the on method to listen for the CONTENT_CAN_PLAY event.

    Parameters

    • type: "contentCanPlay"

      the type of event : CONTENT_CAN_PLAY

    • listener: (() => void)

      the listener function

        • (): void
        • Returns void

    Returns void

  • Use the on method to listen for the CONTENT_PAUSE_REQUESTED event.

    Parameters

    • type: "contentPauseRequested"

      the type of event : CONTENT_PAUSE_REQUESTED

    • listener: (() => void)

      the listener function

        • (): void
        • Returns void

    Returns void

  • Use the on method to listen for the CONTENT_RESUME_REQUESTED event.

    Parameters

    • type: "contentResumeRequested"

      the type of event : CONTENT_RESUME_REQUESTED

    • listener: (() => void)

      the listener function

        • (): void
        • Returns void

    Returns void

  • Use the on method to listen for the ALL_ADS_COMPLETED event.

    Parameters

    • type: "allAdsCompleted"

      the type of event : OmapClientEvent.ALL_ADS_COMPLETED

    • listener: (() => void)

      the listener function

        • (): void
        • Returns void

    Returns void

  • Use the on method to listen for the LOADED event.

    Parameters

    • type: "loaded"

      the type of event : OmapClientEvent.LOADED

    • listener: ((adBreaks) => void)

      the listener function

        • (adBreaks): void
        • Parameters

          Returns void

    Returns void

  • Use the on method to listen for the LOAD_ERROR event.

    Parameters

    • type: "load_error"

      the type of event : OmapClientEvent.LOAD_ERROR

    • listener: (() => void)

      the listener function

        • (): void
        • Returns void

    Returns void

  • Use the on method to listen for the STARTED event.

    Parameters

    • type: "started"

      the type of event : OmapClientEvent.STARTED

    • listener: (() => void)

      the listener function

        • (): void
        • Returns void

    Returns void

  • Use the on method to listen for the COMPLETE event.

    Parameters

    • type: "complete"

      the type of event : OmapClientEvent.COMPLETE

    • listener: (() => void)

      the listener function

        • (): void
        • Returns void

    Returns void

  • Use the on method to listen for the AD_POD_INSERTION_REQUESTED event.

    Parameters

    • type: "adPodInsertionRequested"

      the type of event : OmapClientEvent.AD_POD_INSERTION_REQUESTED

    • listener: ((adPodInsertionRequest) => void)

      the listener function

    Returns void

  • Use the on method to listen for the AD_POD_INSERTION_REQUEST_FAILED event.

    Parameters

    • type: "adPodInsertionRequestFailed"

      the type of event : OmapClientEvent.AD_POD_INSERTION_REQUEST_FAILED

    • listener: (() => void)

      the listener function

        • (): void
        • Returns void

    Returns void

  • Use the on method to listen for the AD_POD_PREPARATION_REQUESTED event.

    Parameters

    • type: "adPodPreparationRequested"

      the type of event : OmapClientEvent.AD_POD_PREPARATION_REQUESTED

    • listener: ((adPodInsertionRequest) => void)

      the listener function

    Returns void

  • Will start playing ads. After calling this method, the client will start to request ads.

    Returns void

Generated using TypeDoc