Roku with IMA SDK
This document describes the Roku MediaMelon Player IMA SDK Integration with the Roku media player.
Step 1: Include MediaMelon SmartStreaming SDK
Step 2: Setup a new MediaMelon Task
Step 3: MediaMelon Code Integrate
Step 4: Error Handling
Step 5: Google IMA Ads Integration
Step 6: Variables and Description
Step 1: Include MediaMelon SmartStreaming SDK
To integrate, unzip the MediaMelon Roku library and place the MMSmartStream
folder in the components directory.
SDK: MediaMelon Roku IMA SDK
Step 2: Setup a new MediaMelon Task
Create a new XML file MMTask.xml
inside your components folder. This is used to link MediaMelon’s brs
files into your application.
The MMTask.xml
file should contain the following:
Step 3: MediaMelon Code Integrate
3.1. Add MMTask Child Component:
Add the MediaMelon MMTask
as a child component to the main video scene custom-playback-channel-master/components/MainScene.xml
3.2. Create MM Task Node:
In the main application, after the video instance has been created, create a MediaMelon Task node, and pass the Video node to it.
CUSTOMER_ID
is your MediaMelon assigned Customer ID. If you do not know your Customer ID contact MediaMelon at customer-support@mediamelon.com.
3.3. Set Configuration Details:
If your workflow restricts the manifest to be accessible from both the player and SDK simultaneously, then you can disable manifest fetch. This is an optional step.
3.4. Set Content Metadata:
3.5. Set Custom Configuration Details:
3.6. Set Codecs:
3.7. Set Custom Metadata:
3.8. Set Seek Threshold:
By default seek threshold is set to 2 seconds
in the SDK.
3.9. Set is Video Live:
Set isVideoLive
to true
for live video stream and to false
for VOD stream
3.10. Set View:
It's important to set the view field start
for every new view starts and to end
when a view ends.
Start View:
End View:
3.11. Run the SDK:
Step 4: Error Handling
By default, SDK listens to the video node for errors. To report custom errors set enableCustomErrorReporting
flag to true and report the errors in the following way;
Upon setting enableCustomErrorReporting
flag to true, SDK will stop listening to the video node errors. Only custom errors will be reported.
4.1. Video Error Reporting:
4.2. Ad Error Reporting:
Step 5: Google IMA Ads Integration
This guide demonstrates how to integrate the Mediamelon Roku SDK into a sample video player app with Google Ima Ads, downloaded the basic example from GitHub.
5.1. Include MediaMelon Ad Plugin:
Include MMImaAdsPlugin.brs
file into SDK.xml
as shown below.
5.2. Create an IMA Stream Player:
Call MediaMelon APIs to notify adBreakStarted
and adBreakEnded
as shown below.
5.3. Add Event Listeners and Start the Stream:
After requesting your stream, add event listeners to track ad progress from MediaMelon SDK by calling an API addMediaMelonAdCallbacks
.
Step 6: Variables and Description
Variable
Description
Optional/Mandatory
PLAYER_NAME
String containing the Player Name.
Mandatory
CUSTOMER_ID
String containing your MediaMelon-assigned Customer ID.
Mandatory
SUBSCRIBER_ID
String containing your Subscriber’s ID.
Mandatory
DOMAIN_NAME
String containing your section of your subscriber or assets.
Mandatory
SUBSCRIBER_TYPE
String containing the Subscriber Type (e.g. “Free”, “Paid”).
Mandatory
SUBSCRIBER_TAG
String containing additional subscriber-specific information. This is sent in clear (not hashed) to SmartSight and it is advised not to send sensitive information in this field.
Optional
ASSET_ID
String containing Asset Id.
Mandatory
ASSET_NAME
String containing Asset Name.
Mandatory
VIDEO_ID
String containing your video’s ID.
Mandatory
CONTENT_TYPE
String containing the type of the Content. For example - "Movie", "Special", "Clip", "Scene" or "Episode".
Mandatory
GENRE
String containing the Genre of the content. For example - "Comedy", "Horror".
Mandatory
DRM_PROTECTION
Widevine, Fairplay, Playready, etc. Unknown means content is protected, but the protection type is unknown. For clear contents, do not set this field
Mandatory
EPISODE_NUMBER
String containing sequence number of the Episode.
Mandatory
SEASON
String containing the Season. For example - "Season 1".
Mandatory
SERIES_TITLE
String containing Title of the Series.
Mandatory
VIDEO_TYPE
String containing Video Type. For example - "LIVE", and "VOD".
Optional
PLAYER_BRAND
String containing Player Brand (e.g. “Exo Player”).
Mandatory
PLAYER_MODEL
String containing Player Model. For example - This could be a variant of a player. Say the name of third third-party player used by the organisation. Or any human-readable name of the player.
Mandatory
PLAYER_VERSION
String containing Player Version.
Mandatory
CUSTOM_KEY_1
Custom metadata key can be added here if required.
Optional
VALUE_1
Custom metadata value can be added here if required.
Optional
BASE_PLAYER_NAME
String containing base player name
Optional
BASE_PLAYER_VERSION
String containing base player version
Optional
EXPERIMENT_NAME
You can use this field to categorise views into different experiments, allowing you to filter by this dimension later.
Optional
SUB_PROPERTY_ID
A sub-property is an optional feature that allows you to organize data within a property. For instance, a video platform could use sub-properties to group data by customer, or a media company might use them to differentiate between its various websites.
Optional
VIEW_SESSION_ID
An ID that can be used to link the view with upstream platform services, such as CDN or origin logs, for correlation purposes.
Optional
hashSubscriberId
To hash the subscriber ID set this boolean variable to true
, else set it to false
.
Optional
player
Player Object.
Mandatory
streamURL
Current playing content stream URL.
Mandatory
isLive
Set this boolean variable to true
if the content is Live else set it to false
for VOD content.
Optional
playerWidth
Integer value that represents width of the player
Mandatory
playerHeight
Integer value that represents height of the player
Mandatory
Last updated
Was this helpful?