GoogleInteractiveMediaAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
IMALiveStreamRequest
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
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
|
|
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
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
|
|
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
Objective-C
- (nonnull instancetype)
initWithAssetKey:(nonnull NSString *)assetKey
adDisplayContainer:(nonnull IMAAdDisplayContainer *)adDisplayContainer
videoDisplay:(nonnull id<IMAVideoDisplay>)videoDisplay
userContext:(nullable id)userContext;
Parameters
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
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
|
|
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
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[null,null,["Last updated 2025-08-20 UTC."],[[["\u003cp\u003e\u003ccode\u003eIMALiveStreamRequest\u003c/code\u003e is a data object that encapsulates the information needed to request and play a live stream.\u003c/p\u003e\n"],["\u003cp\u003eIt uses an \u003ccode\u003eassetKey\u003c/code\u003e to identify the stream, which can be found in the DFP UI.\u003c/p\u003e\n"],["\u003cp\u003eYou can initialize a request with an \u003ccode\u003eassetKey\u003c/code\u003e, \u003ccode\u003eadDisplayContainer\u003c/code\u003e, \u003ccode\u003evideoDisplay\u003c/code\u003e, and optionally, \u003ccode\u003euserContext\u003c/code\u003e and \u003ccode\u003epictureInPictureProxy\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eadDisplayContainer\u003c/code\u003e is used to render ad UI, while the \u003ccode\u003evideoDisplay\u003c/code\u003e handles stream playback.\u003c/p\u003e\n"],["\u003cp\u003eThe optional \u003ccode\u003epictureInPictureProxy\u003c/code\u003e enables tracking of Picture-in-Picture events.\u003c/p\u003e\n"]]],[],null,["# GoogleInteractiveMediaAds Framework Reference\n\nIMALiveStreamRequest\n====================\n\n @interface IMALiveStreamRequest : ../Classes/IMAStreamRequest.html\n\nData object describing a live stream request.\n- `\n ``\n ``\n `\n\n ### [assetKey](#/c:objc(cs)IMALiveStreamRequest(py)assetKey)\n\n `\n ` \n This is used to determine which stream should be played.\n The live stream request asset key is an identifier which can be\n [found in the DFP UI](https://goo.gl/wjL9DI).\n\n @type {!string} \n\n #### Declaration\n\n Swift \n\n var assetKey: String { get }\n\n Objective-C \n\n @property (nonatomic, copy, readonly) NSString *_Nonnull assetKey;\n\n- `\n ``\n ``\n `\n\n ### [-initWithAssetKey:networkCode:adDisplayContainer:videoDisplay:userContext:](#/c:objc(cs)IMALiveStreamRequest(im)initWithAssetKey:networkCode:adDisplayContainer:videoDisplay:userContext:)\n\n `\n ` \n Initializes a live stream request instance with the given assetKey. Uses the given ad display\n container to display the stream. \n\n #### Declaration\n\n Swift \n\n init(assetKey: String, networkCode: String?, adDisplayContainer: ../Classes/IMAAdDisplayContainer.html, videoDisplay: any ../Protocols/IMAVideoDisplay.html, userContext: Any?)\n\n Objective-C \n\n - (nonnull instancetype)\n initWithAssetKey:(nonnull NSString *)assetKey\n networkCode:(nullable NSString *)networkCode\n adDisplayContainer:(nonnull ../Classes/IMAAdDisplayContainer.html *)adDisplayContainer\n videoDisplay:(nonnull id\u003c../Protocols/IMAVideoDisplay.html\u003e)videoDisplay\n userContext:(nullable id)userContext;\n\n #### Parameters\n\n |----------------------------|-------------------------------------------------------------|\n | ` `*assetKey*` ` | the stream assetKey |\n | ` `*networkCode*` ` | the network code for the stream (optional but recommended). |\n | ` `*adDisplayContainer*` ` | the IMAAdDisplayContainer for rendering the ad UI |\n | ` `*videoDisplay*` ` | the IMAVideoDisplay for playing the stream |\n | ` `*userContext*` ` | The user context for tracking requests (optional) |\n\n #### Return Value\n\n the IMALiveStreamRequest instance\n- `\n ``\n ``\n `\n\n ### [-initWithAssetKey:networkCode:adDisplayContainer:videoDisplay:pictureInPictureProxy:userContext:](#/c:objc(cs)IMALiveStreamRequest(im)initWithAssetKey:networkCode:adDisplayContainer:videoDisplay:pictureInPictureProxy:userContext:)\n\n `\n ` \n Initializes a live stream request instance with the given assetKey. Uses the given ad display\n container to display the stream. Uses the picture in picture proxy to track PIP events. \n\n #### Declaration\n\n Swift \n\n init(assetKey: String, networkCode: String?, adDisplayContainer: ../Classes/IMAAdDisplayContainer.html, videoDisplay: any ../Protocols/IMAVideoDisplay.html, pictureInPictureProxy: ../Classes/IMAPictureInPictureProxy.html?, userContext: Any?)\n\n Objective-C \n\n - (nonnull instancetype)\n initWithAssetKey:(nonnull NSString *)assetKey\n networkCode:(nullable NSString *)networkCode\n adDisplayContainer:(nonnull ../Classes/IMAAdDisplayContainer.html *)adDisplayContainer\n videoDisplay:(nonnull id\u003c../Protocols/IMAVideoDisplay.html\u003e)videoDisplay\n pictureInPictureProxy:\n (nullable ../Classes/IMAPictureInPictureProxy.html *)pictureInPictureProxy\n userContext:(nullable id)userContext;\n\n #### Parameters\n\n |-------------------------------|-------------------------------------------------------------|\n | ` `*assetKey*` ` | the stream assetKey |\n | ` `*networkCode*` ` | the network code for the stream (optional but recommended). |\n | ` `*adDisplayContainer*` ` | the IMAAdDisplayContainer for rendering the ad UI |\n | ` `*videoDisplay*` ` | the IMAVideoDisplay for playing the stream |\n | ` `*pictureInPictureProxy*` ` | the IMAPictureInPictureProxy for tracking PIP events |\n | ` `*userContext*` ` | The user context for tracking requests (optional) |\n\n #### Return Value\n\n the IMALiveStreamRequest instance\n- `\n ``\n ``\n `\n\n ### [-initWithAssetKey:adDisplayContainer:videoDisplay:userContext:](#/c:objc(cs)IMALiveStreamRequest(im)initWithAssetKey:adDisplayContainer:videoDisplay:userContext:)\n\n `\n ` \n Deprecated\n\n Use initWithAssetKey:networkCode:adDisplayContainer:videoDisplay:userContext: instead. \n Initializes a live stream request instance with the given assetKey. Uses the given ad display\n container to display the stream. \n\n #### Declaration\n\n Swift \n\n init(assetKey: String, adDisplayContainer: ../Classes/IMAAdDisplayContainer.html, videoDisplay: any ../Protocols/IMAVideoDisplay.html, userContext: Any?)\n\n Objective-C \n\n - (nonnull instancetype)\n initWithAssetKey:(nonnull NSString *)assetKey\n adDisplayContainer:(nonnull ../Classes/IMAAdDisplayContainer.html *)adDisplayContainer\n videoDisplay:(nonnull id\u003c../Protocols/IMAVideoDisplay.html\u003e)videoDisplay\n userContext:(nullable id)userContext;\n\n #### Parameters\n\n |----------------------------|---------------------------------------------------|\n | ` `*assetKey*` ` | the stream assetKey |\n | ` `*adDisplayContainer*` ` | the IMAAdDisplayContainer for rendering the ad UI |\n | ` `*videoDisplay*` ` | the IMAVideoDisplay for playing the stream |\n | ` `*userContext*` ` | The user context for tracking requests (optional) |\n\n #### Return Value\n\n the IMALiveStreamRequest instance\n- `\n ``\n ``\n `\n\n ### [-initWithAssetKey:adDisplayContainer:videoDisplay:pictureInPictureProxy:userContext:](#/c:objc(cs)IMALiveStreamRequest(im)initWithAssetKey:adDisplayContainer:videoDisplay:pictureInPictureProxy:userContext:)\n\n `\n ` \n Deprecated\n\n Use initWithAssetKey:networkCode:adDisplayContainer:videoDisplay:pictureInPictureProxy:userContext: instead. \n Initializes a live stream request instance with the given assetKey. Uses the given ad display\n container to display the stream. Uses the picture in picture proxy to track PIP events. \n\n #### Declaration\n\n Swift \n\n init(assetKey: String, adDisplayContainer: ../Classes/IMAAdDisplayContainer.html, videoDisplay: any ../Protocols/IMAVideoDisplay.html, pictureInPictureProxy: ../Classes/IMAPictureInPictureProxy.html?, userContext: Any?)\n\n Objective-C \n\n - (nonnull instancetype)\n initWithAssetKey:(nonnull NSString *)assetKey\n adDisplayContainer:(nonnull ../Classes/IMAAdDisplayContainer.html *)adDisplayContainer\n videoDisplay:(nonnull id\u003c../Protocols/IMAVideoDisplay.html\u003e)videoDisplay\n pictureInPictureProxy:\n (nullable ../Classes/IMAPictureInPictureProxy.html *)pictureInPictureProxy\n userContext:(nullable id)userContext;\n\n #### Parameters\n\n |-------------------------------|------------------------------------------------------|\n | ` `*assetKey*` ` | the stream assetKey |\n | ` `*adDisplayContainer*` ` | the IMAAdDisplayContainer for rendering the ad UI |\n | ` `*videoDisplay*` ` | the IMAVideoDisplay for playing the stream |\n | ` `*pictureInPictureProxy*` ` | the IMAPictureInPictureProxy for tracking PIP events |\n | ` `*userContext*` ` | The user context for tracking requests (optional) |\n\n #### Return Value\n\n the IMALiveStreamRequest instance"]]