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-01-14 UTC.
[null,null,["Last updated 2025-01-14 UTC."],[[["\u003cp\u003e\u003ccode\u003eIMALiveStreamRequest\u003c/code\u003e is a data object that describes a live stream request, primarily identified by an \u003ccode\u003eassetKey\u003c/code\u003e found in the DFP UI.\u003c/p\u003e\n"],["\u003cp\u003eIt can be initialized using \u003ccode\u003einitWithAssetKey:adDisplayContainer:videoDisplay:userContext:\u003c/code\u003e to request and display a live stream with ads.\u003c/p\u003e\n"],["\u003cp\u003eAlternatively, it can be initialized with \u003ccode\u003einitWithAssetKey:adDisplayContainer:videoDisplay:pictureInPictureProxy:userContext:\u003c/code\u003e to include Picture-in-Picture functionality.\u003c/p\u003e\n"],["\u003cp\u003eThe request requires an \u003ccode\u003eassetKey\u003c/code\u003e, an \u003ccode\u003eIMAAdDisplayContainer\u003c/code\u003e for ad UI, and an \u003ccode\u003eIMAVideoDisplay\u003c/code\u003e to play the stream.\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"]]