GoogleInteractiveMediaAds Framework Reference

  • The IMAAVPlayerVideoDisplayDelegate protocol defines callbacks for interactions with an IMAAVPlayerVideoDisplay, enabling publishers to manage stream loading and content protection.

  • The playerVideoDisplay:willLoadStreamAsset: method allows publishers to register an AVURLAsset for Fairplay before playback, particularly useful for handling protected content.

  • playerVideoDisplay:didLoadPlayerItem: is called when the IMAAVPlayerVideoDisplay has partially or fully loaded media, signaling the availability of an AVPlayerItem primarily for dynamic ad insertion scenarios.

IMAAVPlayerVideoDisplayDelegate

@protocol IMAAVPlayerVideoDisplayDelegate <NSObject>

A callback protocol for IMAAVPlayerVideoDisplayDelegate.

  • Called when the IMAAVPlayerVideoDisplay will load a stream for playback. Allows the publisher to register the AVURLAsset for Fairplay content protection before playback starts.

    Declaration

    Swift

    optional func playerVideoDisplay(_ playerVideoDisplay: IMAAVPlayerVideoDisplay, willLoadStreamAsset URLAsset: AVURLAsset)

    Objective-C

    - (void)playerVideoDisplay:(nonnull IMAAVPlayerVideoDisplay *)playerVideoDisplay
           willLoadStreamAsset:(nonnull AVURLAsset *)URLAsset;

    Parameters

    playerVideoDisplay

    the IMAVPlayerVideoDisplay that will load the AVURLAsset.

    URLAsset

    the AVURLAsset representing the stream to be loaded.

  • Called when the IMAAVPlayerVideoDisplay has at least partially loaded media for playback and the player item is loaded. Only called for dynamic ad insertion.

    Declaration

    Swift

    optional func playerVideoDisplay(_ playerVideoDisplay: IMAAVPlayerVideoDisplay, didLoad playerItem: AVPlayerItem)

    Objective-C

    - (void)playerVideoDisplay:(nonnull IMAAVPlayerVideoDisplay *)playerVideoDisplay
             didLoadPlayerItem:(nonnull AVPlayerItem *)playerItem;