ima. StreamRequest
Constructor
StreamRequest
new StreamRequest()
Used for specifying properties of the stream request.
Properties
adTagParameters
String
Optional. You can override a limited set of ad tag parameters on your stream request. Supply targeting parameters to your stream provides more information. You can also use the dai-ot and dai-ov parameters for stream variant preference. See Override stream variant parameters for more information.
adUiNode
roSGNode
A scene graph node where ad UI displays. IMA places elements like Why This Ad and Skip buttons on this element during ads. The element must overlay the entire video element.
apiKey
String
Optional. These keys can be used to authenticate stream requests. DAI authentication keys must be set up in the DFP UI.
assetKey
String
Required for live streams. 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.
authToken
String
The stream request authorization token. Used in place of the API key for stricter content authorization. The publisher can control individual content streams authorizations based on this token.
contentSourceId
String
Required for on-demand streams. The cmsid comes from the DFP Video Content Source in the DFP UI.
customAssetKey
String
The custom asset key is used to determine which stream should be played. Custom asset keys are required for pod serving stream requests.
format
The format of the stream. Defaults to ima.StreamFormat.HLS.
networkCode
String
The network code for the publisher making the stream request. Network codes are required for Pod serving stream requests made with createPodLiveStreamRequest or createPodVodStreamRequest. These codes are also required for Cloud stitching stream requests made with createVideoStitcherLiveStreamRequest, createVideoStitcherVodStreamRequest, or createVideoStitcherVodStreamRequestWithVodConfig. These codes are optional and recommended for Full service stream requests made with createLiveStreamRequest or createVodStreamRequest. Adding the network code applies settings selected in the Ad Manager UI, such as programmatic limited ads enablement. For Pod serving and Cloud stitching, adding the network code locates and plays the stream. To find the network code, see this article.
player
(ima.Player or Invalid)
An implementation of the player interface.
ppid
String
Deprecated. Use adTagParameters. Optional. A DFP Audience publisher provided identifier.
streamActivityMonitorId
String
The ID to be used to debug the stream with the stream activity monitor. This is used to provide a convenient way to allow publishers to find a stream log in the stream activity monitor tool.
videoId
String
Required for on-demand streams. Identifier for the video content source.
videoObject
(roVideo or Invalid)
The video object (such as the Video roSGNode) responsible for video playback on the client app. This object will be polled for various data to be used in properly timing Live HLS ID3 events.
videoStitcherSessionOptions
Array of V
The session options are used to set video sticher specific parameters for VideoStitcher streamRequests.
Methods
createLiveStreamRequest
createLiveStreamRequest(assetKey, apiKey, networkCode) returns ima.StreamRequest
Initializes required properties of a Live StreamRequest. Using
this API causes any other StreamType-specific properties to be
ignored.
If any required parameters are empty strings, error logging occurs and the API
returns a generic StreamRequest, with no properties ignored.
Parameter |
|
|---|---|
|
assetKey |
string |
|
apiKey |
string Parameter assigned to the returned
|
|
networkCode |
string Network code for the publisher making the stream request. Including the network code is optional, but recommended. |
- Returns
-
ima.StreamRequestima.StreamRequestobject with required Live properties.
createPodLiveStreamRequest
createPodLiveStreamRequest(customAssetKey, networkCode, apiKey) returns StreamRequest
Initializes required properties of a Pod Live ima.StreamRequest.
Using this API causes any other ima.StreamType-specific
properties to be ignored.
If any required parameters are empty strings, error logging occurs and the API
returns a generic StreamRequest, with no properties ignored.
Parameter |
|
|---|---|
|
customAssetKey |
string |
|
networkCode |
string |
|
apiKey |
string Optional parameter assigned to the
returned |
- Returns
-
StreamRequestima.StreamRequestobject with required PodLive properties.
createPodVodStreamRequest
createPodVodStreamRequest(networkCode) returns StreamRequest
Initializes the required properties of a ima.StreamRequest to
register a VOD stream when using DAI Pod serving with a third party video
stitcher. This function sets the request type to
ima.StreamType.POD_VOD and validates all required properties
for missing data. Failed validations will log an error in the debug
console.
Parameter |
|
|---|---|
|
networkCode |
string the Google Ad Manager network code |
- Returns
-
StreamRequestanima.StreamRequestobject. If all required properties are specified, the request type is set toima.StreamType.POD_VOD.
createStreamRequest
createStreamRequest() returns ima.StreamRequest
- Returns
-
ima.StreamRequestAn emptyima.StreamRequestobject.
createVideoStitcherLiveStreamRequest
createVideoStitcherLiveStreamRequest(customAssetKey, networkCode, liveConfigId, region, projectNumber, oAuthToken) returns ima.StreamRequest
Initializes required properties of a Video Stitcher Live
StreamRequest. Using this API causes any other
StreamType-specific properties to be ignored.
If any required parameters are empty strings, error logging occurs and the API
returns a generic StreamRequest, with no properties ignored.
Parameter |
|
|---|---|
|
customAssetKey |
string |
|
networkCode |
string |
|
liveConfigId |
string |
|
region |
string |
|
projectNumber |
string |
|
oAuthToken |
string |
- Returns
-
ima.StreamRequestima.StreamRequestobject with required VideoStitcherLive properties.
createVideoStitcherVodStreamRequest
createVideoStitcherVodStreamRequest(adTagUrl, networkCode, contentSourceUrl, region, projectNumber, oAuthToken) returns ima.StreamRequest
Initializes required properties of a Video Stitcher VOD
StreamRequest. Using this API causes any other
StreamType-specific properties to be ignored.
If any required parameters are empty strings, error logging occurs and the API
returns a generic StreamRequest, with no properties ignored.
Parameter |
|
|---|---|
|
adTagUrl |
string |
|
networkCode |
string |
|
contentSourceUrl |
string |
|
region |
string |
|
projectNumber |
string |
|
oAuthToken |
string |
- Returns
-
ima.StreamRequestima.StreamRequestobject with required VideoStitcherVod properties.
createVideoStitcherVodStreamRequestWithVodConfig
createVideoStitcherVodStreamRequestWithVodConfig(vodConfigId, networkCode, region, projectNumber, oAuthToken) returns ima.StreamRequest
Initializes required properties of a Video Stitcher VOD
StreamRequest using vodConfigId created from cloud
video stitcher.
Using this API causes any other StreamType-specific properties to
be ignored.
If any required parameters are empty strings, error logging occurs and the API
returns a generic StreamRequest, with no properties ignored.
Parameter |
|
|---|---|
|
vodConfigId |
string |
|
networkCode |
string |
|
region |
string |
|
projectNumber |
string |
|
oAuthToken |
string |
- Returns
-
ima.StreamRequestima.StreamRequestobject with required VideoStitcherVod properties.
createVodStreamRequest
createVodStreamRequest(contentSourceId, videoId, apiKey, networkCode) returns ima.StreamRequest
Initializes required properties of a VOD ima.StreamRequest. Using
this API causes any other ima.StreamType-specific properties to
be ignored.
If any required parameters are empty strings, error logging occurs and the API
returns a generic StreamRequest, with no properties ignored.
Parameter |
|
|---|---|
|
contentSourceId |
string |
|
videoId |
string |
|
apiKey |
string Parameter assigned to the returned
|
|
networkCode |
string Network code for the publisher making the stream request. Including the network code is optional, but recommended. |
- Returns
-
ima.StreamRequestima.StreamRequestobject with required VOD properties.