GoogleInteractiveMediaAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
IMAVODStreamRequest
Data object describing a VOD stream request.
-
The stream request content source ID. This is used to determine the
content source of the stream.
Declaration
Swift
var contentSourceID: String { get }
Objective-C
@property (nonatomic, copy, readonly) NSString *_Nonnull contentSourceID;
-
The stream request video ID. This is used to determine which specific video
stream should be played.
Declaration
Swift
var videoID: String { get }
Objective-C
@property (nonatomic, copy, readonly) NSString *_Nonnull videoID;
-
Initializes a stream request instance with the given content source ID and video ID.
Uses the given ad display container to display the stream. This is used for on-demand streams.
Declaration
Objective-C
- (nonnull instancetype)
initWithContentSourceID:(nonnull NSString *)contentSourceID
videoID:(nonnull NSString *)videoID
networkCode:(nullable NSString *)networkCode
adDisplayContainer:(nonnull IMAAdDisplayContainer *)adDisplayContainer
videoDisplay:(nonnull id<IMAVideoDisplay>)videoDisplay
userContext:(nullable id)userContext;
Parameters
contentSourceID
|
the content source ID for this stream
|
videoID
|
the video identifier for this stream
|
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 IMAVODStreamRequest instance
-
Initializes a stream request instance with the given content source ID and video ID.
Uses the given ad display container to display the stream. This is used for on-demand streams.
Uses the picture in picture proxy to track PIP events.
Declaration
Objective-C
- (nonnull instancetype)
initWithContentSourceID:(nonnull NSString *)contentSourceID
videoID:(nonnull NSString *)videoID
networkCode:(nullable NSString *)networkCode
adDisplayContainer:(nonnull IMAAdDisplayContainer *)adDisplayContainer
videoDisplay:(nonnull id<IMAVideoDisplay>)videoDisplay
pictureInPictureProxy:
(nullable IMAPictureInPictureProxy *)pictureInPictureProxy
userContext:(nullable id)userContext;
Parameters
contentSourceID
|
the content source ID for this stream
|
videoID
|
the video identifier for this stream
|
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 IMAVODStreamRequest instance
-
Deprecated
Use contentSourceID:videoId:networkCode:adDisplayContainer:videoDisplay:userContext: instead.
Initializes a stream request instance with the given content source ID and video ID.
Uses the given ad display container to display the stream. This is used for on-demand streams.
Declaration
Objective-C
- (nonnull instancetype)
initWithContentSourceID:(nonnull NSString *)contentSourceID
videoID:(nonnull NSString *)videoID
adDisplayContainer:(nonnull IMAAdDisplayContainer *)adDisplayContainer
videoDisplay:(nonnull id<IMAVideoDisplay>)videoDisplay
userContext:(nullable id)userContext;
Parameters
contentSourceID
|
the content source ID for this stream
|
videoID
|
the video identifier for this stream
|
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 IMAVODStreamRequest instance
-
Deprecated
Use initWithContentSourceID:videoID:networkCode:adDisplayContainer:videoDisplay:pictureInPictureProxy:userContext: instead.
Initializes a stream request instance with the given content source ID and video ID.
Uses the given ad display container to display the stream. This is used for on-demand streams.
Uses the picture in picture proxy to track PIP events.
Declaration
Objective-C
- (nonnull instancetype)
initWithContentSourceID:(nonnull NSString *)contentSourceID
videoID:(nonnull NSString *)videoID
adDisplayContainer:(nonnull IMAAdDisplayContainer *)adDisplayContainer
videoDisplay:(nonnull id<IMAVideoDisplay>)videoDisplay
pictureInPictureProxy:
(nullable IMAPictureInPictureProxy *)pictureInPictureProxy
userContext:(nullable id)userContext;
Parameters
contentSourceID
|
the content source ID for this stream
|
videoID
|
the video identifier for this stream
|
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 IMAVODStreamRequest 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\u003eIMAVODStreamRequest\u003c/code\u003e is a data object that describes a video-on-demand (VOD) stream request.\u003c/p\u003e\n"],["\u003cp\u003eIt requires a \u003ccode\u003econtentSourceID\u003c/code\u003e to identify the stream's source and a \u003ccode\u003evideoID\u003c/code\u003e to specify the video.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eIMAVODStreamRequest\u003c/code\u003e can be initialized with an \u003ccode\u003eadDisplayContainer\u003c/code\u003e for ad UI, a \u003ccode\u003evideoDisplay\u003c/code\u003e for playback, and optionally, a \u003ccode\u003epictureInPictureProxy\u003c/code\u003e and \u003ccode\u003euserContext\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThis class is used to initiate on-demand video streams with ad support within the IMA SDK.\u003c/p\u003e\n"]]],["IMAVODStreamRequest manages VOD stream requests, using `contentSourceID` and `videoID` to specify the stream. It initializes with these IDs, along with `networkCode` (optional), `adDisplayContainer` for ad UI, `videoDisplay` for stream playback, and optional `userContext`. It supports Picture-in-Picture (PIP) event tracking via `pictureInPictureProxy`. Several initializers are available, including deprecated versions, all returning an `IMAVODStreamRequest` instance.\n"],null,["# GoogleInteractiveMediaAds Framework Reference\n\nIMAVODStreamRequest\n===================\n\n @interface IMAVODStreamRequest : ../Classes/IMAStreamRequest.html\n\nData object describing a VOD stream request.\n- `\n ``\n ``\n `\n\n ### [contentSourceID](#/c:objc(cs)IMAVODStreamRequest(py)contentSourceID)\n\n `\n ` \n The stream request content source ID. This is used to determine the\n content source of the stream. \n\n #### Declaration\n\n Swift \n\n var contentSourceID: String { get }\n\n Objective-C \n\n @property (nonatomic, copy, readonly) NSString *_Nonnull contentSourceID;\n\n- `\n ``\n ``\n `\n\n ### [videoID](#/c:objc(cs)IMAVODStreamRequest(py)videoID)\n\n `\n ` \n The stream request video ID. This is used to determine which specific video\n stream should be played. \n\n #### Declaration\n\n Swift \n\n var videoID: String { get }\n\n Objective-C \n\n @property (nonatomic, copy, readonly) NSString *_Nonnull videoID;\n\n- `\n ``\n ``\n `\n\n ### [-initWithContentSourceID:videoID:networkCode:adDisplayContainer:videoDisplay:userContext:](#/c:objc(cs)IMAVODStreamRequest(im)initWithContentSourceID:videoID:networkCode:adDisplayContainer:videoDisplay:userContext:)\n\n `\n ` \n Initializes a stream request instance with the given content source ID and video ID.\n Uses the given ad display container to display the stream. This is used for on-demand streams. \n\n #### Declaration\n\n Swift \n\n init(contentSourceID: String, videoID: String, networkCode: String?, adDisplayContainer: ../Classes/IMAAdDisplayContainer.html, videoDisplay: any ../Protocols/IMAVideoDisplay.html, userContext: Any?)\n\n Objective-C \n\n - (nonnull instancetype)\n initWithContentSourceID:(nonnull NSString *)contentSourceID\n videoID:(nonnull NSString *)videoID\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 | ` `*contentSourceID*` ` | the content source ID for this stream |\n | ` `*videoID*` ` | the video identifier for this stream |\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 IMAVODStreamRequest instance\n- `\n ``\n ``\n `\n\n ### [-initWithContentSourceID:videoID:networkCode:adDisplayContainer:videoDisplay:pictureInPictureProxy:userContext:](#/c:objc(cs)IMAVODStreamRequest(im)initWithContentSourceID:videoID:networkCode:adDisplayContainer:videoDisplay:pictureInPictureProxy:userContext:)\n\n `\n ` \n Initializes a stream request instance with the given content source ID and video ID.\n Uses the given ad display container to display the stream. This is used for on-demand streams.\n Uses the picture in picture proxy to track PIP events. \n\n #### Declaration\n\n Swift \n\n init(contentSourceID: String, videoID: 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 initWithContentSourceID:(nonnull NSString *)contentSourceID\n videoID:(nonnull NSString *)videoID\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 | ` `*contentSourceID*` ` | the content source ID for this stream |\n | ` `*videoID*` ` | the video identifier for this stream |\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 IMAVODStreamRequest instance\n- `\n ``\n ``\n `\n\n ### [-initWithContentSourceID:videoID:adDisplayContainer:videoDisplay:userContext:](#/c:objc(cs)IMAVODStreamRequest(im)initWithContentSourceID:videoID:adDisplayContainer:videoDisplay:userContext:)\n\n `\n ` \n Deprecated\n\n Use contentSourceID:videoId:networkCode:adDisplayContainer:videoDisplay:userContext: instead. \n Initializes a stream request instance with the given content source ID and video ID.\n Uses the given ad display container to display the stream. This is used for on-demand streams. \n\n #### Declaration\n\n Swift \n\n init(contentSourceID: String, videoID: String, adDisplayContainer: ../Classes/IMAAdDisplayContainer.html, videoDisplay: any ../Protocols/IMAVideoDisplay.html, userContext: Any?)\n\n Objective-C \n\n - (nonnull instancetype)\n initWithContentSourceID:(nonnull NSString *)contentSourceID\n videoID:(nonnull NSString *)videoID\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 | ` `*contentSourceID*` ` | the content source ID for this stream |\n | ` `*videoID*` ` | the video identifier for this stream |\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 IMAVODStreamRequest instance\n- `\n ``\n ``\n `\n\n ### [-initWithContentSourceID:videoID:adDisplayContainer:videoDisplay:pictureInPictureProxy:userContext:](#/c:objc(cs)IMAVODStreamRequest(im)initWithContentSourceID:videoID:adDisplayContainer:videoDisplay:pictureInPictureProxy:userContext:)\n\n `\n ` \n Deprecated\n\n Use initWithContentSourceID:videoID:networkCode:adDisplayContainer:videoDisplay:pictureInPictureProxy:userContext: instead. \n Initializes a stream request instance with the given content source ID and video ID.\n Uses the given ad display container to display the stream. This is used for on-demand streams.\n Uses the picture in picture proxy to track PIP events. \n\n #### Declaration\n\n Swift \n\n init(contentSourceID: String, videoID: 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 initWithContentSourceID:(nonnull NSString *)contentSourceID\n videoID:(nonnull NSString *)videoID\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 | ` `*contentSourceID*` ` | the content source ID for this stream |\n | ` `*videoID*` ` | the video identifier for this stream |\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 IMAVODStreamRequest instance"]]