The session object which represents a successfully initialized MediaTailor session. This object exposes the methods/properties to manage or monitor the MediaTailor session.

interface Session {
    addAdObserver(adObserver): void;
    addEventListener(type, listener, options?): void;
    destroy(): void;
    getAllAds(): AdData[];
    getAllNonLinearAds(): NonLinearAdsData[];
    getPalNonce(): string;
    getPlaybackUrl(): string;
    getTrackingUrl(): string;
    onAdClickthrough(): void;
    onAdSkip(): void;
    onPlaybackEvent(playbackEvent): void;
    onPlaybackRateUpdate(rate): void;
    onPlayerControlClick(event): void;
    onPlayheadUpdate(playhead, programDateTime?): void;
    onVideoClick(event): void;
    removeAdObserver(adObserver): void;
    removeEventListener(type, listener, options?): void;
    startUpdatingAdTrackingInfo(requestInterval): void;
    stopUpdatingAdTrackingInfo(): void;
    updateAdTrackingInfo(): void;
}

Hierarchy (view full)

Methods

  • Add an ad observer.

    Parameters

    • adObserver: AdObserver

      The ad observer to be added.

    Returns void

  • Add a UI event listener.

    Parameters

    • type: string

      A case-sensitive string representing the event type to listen for.

    • listener: any

      The object or function that receives a notification when an event of the specified type occurs.

    • Optional options: any

      The options that specify characteristics about the event listener.

    Returns void

  • Destroy the session object and free related resources.

    Returns void

  • Get the list of all the ads that are currently being tracked.

    Returns AdData[]

  • Return the nonce generated by Google PAL SDK for this session if available. Otherwise null.

    Returns string

  • Return the URL to be used by a player for content stream playback, with inserted ads. If the MediaTailor session was initialized elsewhere, return null.

    Returns string

  • Return the URL to be used to retrieve information for ad tracking.

    Returns string

  • For the caller to notify the session object about the click-through of the current ad.

    Returns void

  • For the caller to notify the session object about the current ad being skipped.

    Returns void

  • For the caller to notify the session object about a playback event.

    Parameters

    • playbackEvent: PlaybackEvent

      The playback event that just occurred.

    Returns void

  • For the caller to notify the session object about the current playback rate.

    Parameters

    • rate: number

      The current playback rate as a ratio to the normal (1x) speed. For example, 0.5 if the media is playing at half the normal speed.

    Returns void

  • For the caller to notify the session object about the player's UI control being clicked.

    Parameters

    • event: any

      The click or touch event that was fired for the user interaction.

    Returns void

  • For the caller to notify the session object about the current playhead position.

    Parameters

    • playhead: number

      The current playhead position as the elapsed time on the media timeline, in seconds.

    • Optional programDateTime: number

      The program-date-time (usually available for live streams, as epoch time in seconds) corresponding to the current playhead position.

    Returns void

  • For the caller to notify the session object about the player or video element being clicked.

    Parameters

    • event: any

      The click or touch event that was fired for the user interaction.

    Returns void

  • Remove an ad observer.

    Parameters

    • adObserver: AdObserver

      The ad observer to be removed.

    Returns void

  • Remove a UI event listener.

    Parameters

    • type: string

      A string which specifies the type of event for which to remove an event listener.

    • listener: any

      The event listener to remove.

    • Optional options: any

      The options that specify characteristics about the event listener.

    Returns void

  • For the caller to manually start/restart periodic ad tracking info requests.

    Parameters

    • requestInterval: number

      The interval (in seconds) between consecutive tracking info requests. If it is set to 0 or left unspecified, the built-in default value will be used. If it is set to a negative value, the periodic ad tracking info polling will be suspended.

    Returns void

  • For the caller to manually stop periodic ad tracking info requests.

    Returns void

  • For the caller to manually trigger a single request to update ad tracking information.

    Returns void

Generated using TypeDoc