Skip to main content

Integration Document for Roku Google IMA DAI

Setup

The IMA SDK depends on the Roku Advertising Framework. To load the framework, add the following to manifest:

bs_libs_required=roku_ads_lib,googleima3

Create Stream Asset for VOD

The imaStreamInfo key is required in the asset to play content with Google IMA Player. It requires the contentSourceId and videoId to determine the specific video stream and its source. Additionally, you can configure parameters such as apiKey, type.

Parameters

ParameterTypeDescription
contentSourceIdStringThe content source ID for the stream request.
videoIdStringThe video ID for the stream request.
apiKeyStringThis key can be used to authenticate stream requests.
typeStringThis key can be used to specify type of the content either vod or live
dfp_cust_paramsStringThis key is optional in the asset to provide adTagParameters to stream request

Example Usage

Example usage of VOD Asset:

{
"name": "IMA-VOD",
.
.
.
.
"custom": {
"dfp_cust_params": "roku_ad_keys%3D30-0.0-PU02-roku%2C30-14.0-PU03- roku%26roku_ad_query_id%3D6662004937636311054",
},
"imaStreamInfo": {
"contentSourceId": "2668819",
"videoId": "00915BB8-6481-497B-BAF2-8277DED2A703-A",
"apiKey": "",
"type": "vod"
}
}

Create Stream Asset for LIVE

The imaStreamInfo key is required in the asset to play content with Google IMA Player. It requires the assetKey to determine the specific video stream and its source. Additionally, you can configure parameters such as apiKey, type.

Parameters

ParameterTypeDescription
assetKeyStringIdentifier of the live stream. This is used to determine which stream should be played.
apiKeyStringThis key can be used to authenticate stream requests.
typeStringThis key can be used to specify type of the content either vod or live
dfp_cust_paramsStringThis key is optional in the asset to provide adTagParameters to stream request

Example Usage

Example usage of Live Asset:

{
"name": "IMA-Live",
.
.
.
.
"custom": {
"dfp_cust_params": "roku_ad_keys%3D30-0.0-PU02-roku%2C30-14.0-PU03- roku%26roku_ad_query_id%3D6662004937636311054",
},
"imaStreamInfo": {
"contentSourceId": "2668819",
"videoId": "00915BB8-6481-497B-BAF2-8277DED2A703-A",
"apiKey": "",
"type": "vod"
}
}

Create GoogleIma Ads Player

The FLAdGoogleImaPlayer component can be created programmatically as well as can be added to a Scene Graph node component directly.

flPlayer = createObject("roSGNode", "FLAdGoogleImaPlayer")
AD TAG PARAMETERS

The Ad Player exposes api for LIVE content to replace ad tag parameters

REPLACE_AD_TAG_PARAMETERS

This function can be invoked as follows:

flPlayer.callFunc(m.flPlayerFunctions.REPLACE_AD_TAG_PARAMETERS, <uri-encoded-string>)

RAF (Roku Advertising Framework)

Since Roku mandates all channel apps that include video advertising to use RAF, the fl-ad-googleima library uses RAF by default.

RAF APIs with FLAdGoogleImaPlayer

The ad player exposes the RAF APIs as follows.

SET_CONTENT_GENRE
SET_CONTENT_ID
SET_CONTENT_LENGTH
SET_NIELSEN_GENRE
SET_NIELSEN_APP_ID

These functions can be invoked as follows:

flPlayer.callFunc(m.flPlayerFunctions.SET_CONTENT_GENRE, "Adventure, Drama", false)
flPlayer.callFunc(m.flPlayerFunctions.SET_CONTENT_ID,"<content-id>")
flPlayer.callFunc(m.flPlayerFunctions.SET_CONTENT_LENGTH, 1200)
flPlayer.callFunc(m.flPlayerFunctions.SET_NIELSEN_GENRE, "<nielsen-genre>")
flPlayer.callFunc(m.flPlayerFunctions.SET_NIELSEN_APP_ID, "<nielsen-app-id>")