AdManagerInterstitialEventDatasource

@objc(AASDKAdManagerInterstitialEventDatasource)
public protocol AdManagerInterstitialEventDatasource

@protocol

The AdManagerInterstitialEventDatasource protocol defines the methods used to provide AdswizzSDK with various data during a livestream ad replacement.

  • Called when the AdManager is preparing all ads during the .prepare() call and the AdManagerSettings contains an adInterstitialEventMonitor reference. Use it for the livestream ad-replacement scenario to customize the mediafile URL for each ad in the ad pod during the associated AVPlayerInterstitialEvent. For each ad in the ad pod, the AdManager will receive your (custom) media file URLs and use them internally to identify and match the appropriate AVPlayerIteminstances handled by the interstitialPlayer (AVQueuePlayer). Therefore, you should pass the URL which was used to build the associated AVPlayerItem before passing them as templateItems when building the AVPlayerInterstitialEvent.

    By default, the AdManager expects that the AVPlayerItems use and load the MediaFiles from the VAST response. Implementing this method is not required, e.g if your scheduled AVPlayerInterstitialEvent uses the ad’s MediaFiles from the VAST response.

    Important: Note that the AdManagerwill not observe the AVPlayerItems from the interstitialPlayer (AVQueuePlayer) if it detects a mismatch between the URL you provide here and the URL used to create the AVPlayerItem itself. In this case, the AdManager will not initiate any tracking and will not emit any Ad Events for the respective AdData.

    Declaration

    Swift

    @objc
    optional func adManager(_ adManager: AdManager, interstitialMediaFileURL ad: AdData) -> URL?

    Parameters

    adManager

    The AdManager that sent the event

    ad

    The AdData for which the event was sent

    Return Value

    the URL which was used in the template AVPlayerItem when the AVPlayerInterstitialEvent is constructed