GoogleInteractiveMediaAds Framework Reference

  • IMALiveStreamRequest is a data object that describes a live stream request, primarily used for initiating playback of live streams.

  • The assetKey property is an identifier used to specify which live stream should be played.

  • IMALiveStreamRequest provides two initializers for creating instances: one with basic parameters (assetKey, adDisplayContainer, videoDisplay, userContext) and another that also includes a pictureInPictureProxy for tracking Picture-in-Picture events.

  • The initializers allow for configuring the ad display, video playback, and optional user context for the live stream request.

IMALiveStreamRequest

@interface IMALiveStreamRequest : IMAStreamRequest

Data object describing a live stream request.

  • This is used to determine which stream should be played. The live stream request asset key is an identifier which can be found in the DFP UI.

    @type {!string}

    Declaration

    Swift

    var assetKey: String { get }

    Objective-C

    @property (nonatomic, copy, readonly) NSString *_Nonnull assetKey;
  • Initializes a live stream request instance with the given assetKey. Uses the given ad display container to display the stream.

    Declaration

    Swift

    init(assetKey: String, networkCode: String?, adDisplayContainer: IMAAdDisplayContainer, videoDisplay: any IMAVideoDisplay, userContext: Any?)

    Objective-C

    - (nonnull instancetype)
          initWithAssetKey:(nonnull NSString *)assetKey
               networkCode:(nullable NSString *)networkCode
        adDisplayContainer:(nonnull IMAAdDisplayContainer *)adDisplayContainer
              videoDisplay:(nonnull id<IMAVideoDisplay>)videoDisplay
               userContext:(nullable id)userContext;

    Parameters

    assetKey

    the stream assetKey

    networkCode

    the network code for the stream (optional but recommended).

    adDisplayContainer

    the IMAAdDisplayContainer for rendering the ad UI

    videoDisplay

    the IMAVideoDisplay for playing the stream

    userContext

    The user context for tracking requests (optional)

    Return Value

    the IMALiveStreamRequest instance

  • Initializes a live stream request instance with the given assetKey. Uses the given ad display container to display the stream. Uses the picture in picture proxy to track PIP events.

    Declaration

    Swift

    init(assetKey: String, networkCode: String?, adDisplayContainer: IMAAdDisplayContainer, videoDisplay: any IMAVideoDisplay, pictureInPictureProxy: IMAPictureInPictureProxy?, userContext: Any?)

    Objective-C

    - (nonnull instancetype)
             initWithAssetKey:(nonnull NSString *)assetKey
                  networkCode:(nullable NSString *)networkCode
           adDisplayContainer:(nonnull IMAAdDisplayContainer *)adDisplayContainer
                 videoDisplay:(nonnull id<IMAVideoDisplay>)videoDisplay
        pictureInPictureProxy:
            (nullable IMAPictureInPictureProxy *)pictureInPictureProxy
                  userContext:(nullable id)userContext;

    Parameters

    assetKey

    the stream assetKey

    networkCode

    the network code for the stream (optional but recommended).

    adDisplayContainer

    the IMAAdDisplayContainer for rendering the ad UI

    videoDisplay

    the IMAVideoDisplay for playing the stream

    pictureInPictureProxy

    the IMAPictureInPictureProxy for tracking PIP events

    userContext

    The user context for tracking requests (optional)

    Return Value

    the IMALiveStreamRequest instance

  • Deprecated

    Use initWithAssetKey:networkCode:adDisplayContainer:videoDisplay:userContext: instead.

    Initializes a live stream request instance with the given assetKey. Uses the given ad display container to display the stream.

    Declaration

    Swift

    init(assetKey: String, adDisplayContainer: IMAAdDisplayContainer, videoDisplay: any IMAVideoDisplay, userContext: Any?)

    Objective-C

    - (nonnull instancetype)
          initWithAssetKey:(nonnull NSString *)assetKey
        adDisplayContainer:(nonnull IMAAdDisplayContainer *)adDisplayContainer
              videoDisplay:(nonnull id<IMAVideoDisplay>)videoDisplay
               userContext:(nullable id)userContext;

    Parameters

    assetKey

    the stream assetKey

    adDisplayContainer

    the IMAAdDisplayContainer for rendering the ad UI

    videoDisplay

    the IMAVideoDisplay for playing the stream

    userContext

    The user context for tracking requests (optional)

    Return Value

    the IMALiveStreamRequest instance

  • Deprecated

    Use initWithAssetKey:networkCode:adDisplayContainer:videoDisplay:pictureInPictureProxy:userContext: instead.

    Initializes a live stream request instance with the given assetKey. Uses the given ad display container to display the stream. Uses the picture in picture proxy to track PIP events.

    Declaration

    Swift

    init(assetKey: String, adDisplayContainer: IMAAdDisplayContainer, videoDisplay: any IMAVideoDisplay, pictureInPictureProxy: IMAPictureInPictureProxy?, userContext: Any?)

    Objective-C

    - (nonnull instancetype)
             initWithAssetKey:(nonnull NSString *)assetKey
           adDisplayContainer:(nonnull IMAAdDisplayContainer *)adDisplayContainer
                 videoDisplay:(nonnull id<IMAVideoDisplay>)videoDisplay
        pictureInPictureProxy:
            (nullable IMAPictureInPictureProxy *)pictureInPictureProxy
                  userContext:(nullable id)userContext;

    Parameters

    assetKey

    the stream assetKey

    adDisplayContainer

    the IMAAdDisplayContainer for rendering the ad UI

    videoDisplay

    the IMAVideoDisplay for playing the stream

    pictureInPictureProxy

    the IMAPictureInPictureProxy for tracking PIP events

    userContext

    The user context for tracking requests (optional)

    Return Value

    the IMALiveStreamRequest instance