MediaMelon Roku SDK Integration Document
This document describes the Roku MediaMelon Player SDK Integration with the Roku media player.
Step 1: Include MediaMelon SmartStreaming SDK
Step 2: Set up a new MediaMelon Task
Step 3: MediaMelon Code Integration
Step 4: Request Information
Step 5: Error Handling
Step 6: Ad Data & Ad Events
Step 7: Custom Events
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 SDK
Step 2: Set up a new MediaMelon Task
Create a new XML file MMTask.xml inside your components folder. This is used to link MediaMelon’s brsfiles into your application.
The MMTask.xmlfile should contain the following:
<component name="MMTask" extends="Task">
<interface>
<field id="video" type="node" alwaysNotify="true" />
<field id="config" type="assocarray" alwaysNotify="true" />
<field id="customConfig" type="assocarray" alwaysNotify="true" />
<field id="contentMetadata" type="assocarray" alwaysNotify="true" />
<field id="customTags" type="assocarray" alwaysNotify="true" />
<field id="error" type="assocarray" alwaysNotify="true"/>
<field id="adError" type="assocarray" alwaysNotify="true"/>
<field id="view" type="String" alwaysNotify="true" />
<field id="exit" type="Boolean" alwaysNotify="true" />
<field id="mmRafEvent" type="assocarray" alwaysNotify="true"/>
<field id="sdk_version" type="String" alwaysNotify="true" />
<field id="seekThreshold" type="Integer" alwaysNotify="true"/>
<field id="codecs" type="assocarray" alwaysNotify="true" />
<field id="isVideoLive" type="Boolean" alwaysNotify="true" />
<field id="requestInfo" type="assocarray" alwaysNotify="true" />
<field id="customEvent" type="assocarray" alwaysNotify="true" />
<field id="deviceInfo" type="assocarray" alwaysNotify="true" />
</interface>
<script type="text/brightscript" uri="pkg:/components/MMSmartStream/MMNetworkHandler.brs" />
<script type="text/brightscript" uri="pkg:/components/MMSmartStream/MMSmartStreamWrapper.brs" />
<script type="text/brightscript" uri="pkg:/components/MMSmartStream/MMSmartStreamEngine.brs" />
<script type="text/brightscript" uri="pkg:/components//MMSmartStream/MMSmartStreamRokuPlugin.brs" />
<script type="text/brightscript" uri="pkg:/components/MMSmartStream/Utilities.brs" />
</component>
Step 3: MediaMelon Code Integration
3.1. 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.
3.2. Set Configuration Details:
3.3. Set Content Metadata:
3.4. Set Custom Configuration Details:
3.5. Set Codecs:
3.6. Set Custom Metadata:
3.7. Set Seek Threshold:
By default seek threshold is set to 1.25 seconds in the SDK.
3.8. Set is Video Live:
Set isVideoLive to true for live video stream and to false for the VOD stream
3.9. Set View:
Start View:
End View:
3.10. Run the SDK:
3.11. Device Info:
Step 4: Request Information
Report failed or cancelled requests for the following request types:
PIR
MANIFEST
AUDIO_CHUNK
VIDEO_CHUNK
DRM
SUBTITLE
Step 5: Error Handling
By default, the SDK listens to the video node for errors. To report custom errors, set enableCustomErrorReporting flag to true in MMConfig and report the errors in the following way;
5.1. Video Error Reporting:
5.2. Ad Error Reporting:
Step 6: Ad Data & Ad Events:
Sample: rafEventData = { obj: rafData, eventType: "Start", ctx: ctx }
Step 7: Custom Events:
The Custom Events API can be used to report events that are not covered by the default MediaMelon-supported events. Custom events must be reported within the SDK activity lifecycle. Events reported before SDK initialization or after session end will be ignored. Please refer to the guidelines and constraints below.
Release Notes
Last updated