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

Release Notes

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 SDKarrow-up-right

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" />
  </interface>
  <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. Add MMTask Child Component:

Add the MediaMelon MMTask as a child component of 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.

circle-info

CUSTOMER_ID is your MediaMelon assigned Customer ID. If you do not know your Customer ID, contact MediaMelon at [email protected]envelope.

3.3. Set Configuration Details:

circle-info
  • disableManifestFetch: If your workflow restricts the manifest to be accessible from both the player and SDK simultaneously, you can disable manifest fetch. This is an optional step.

  • hashSubscriberId: Set true to hash the subscriberId and to false to process the subscriberId without hashing.

  • enableCustomErrorReporting: If set to true SDK will consider only client-reported errors, else if set to false SDK will consider errors from the video node. (Refer Here)

3.4. Set Content Metadata:

3.5. Set Custom Configuration Details:

3.6. Set Codecs:

3.7. Set Custom Metadata:

circle-info

For Custom Metadata, first, provide the mapping in the SmartSightarrow-up-right dashboard under the settings section, and send the values to the SDK accordingly.

3.8. Set Seek Threshold:

By default seek threshold is set to 1.25 seconds in the SDK.

3.9. Set is Video Live:

Set isVideoLive to true for live video stream and to false for the VOD stream

3.10. Set View:

circle-info

It's important to set the view field start for every new view start, and to end when the view ends.

  • Start View:

  • End View:

3.11. Run the SDK:

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;

circle-info

Upon setting enableCustomErrorReporting flag to true, SDK will stop listening to the video node errors. Only custom errors will be reported.

5.1. Video Error Reporting:

circle-info

error_severity: Set this to "warning" for warnings and set to "fatal" for fatal errors.

5.2. Ad Error Reporting:

Release Notes

chevron-rightCurrent Releasehashtag

v2.8.0

  • Added CDN_CHANGE event functionality.

  • Added Seek Duration calculation internally.

  • Added Audio and Video Codecs in Rendition Event


chevron-rightPrevious Releaseshashtag

v2.7.2

  • Cleaned up the content change handler

v2.7.1

  • Fixed a bug in HTTP port handling in the case of upnext.

v2.7.0

  • Updated network call handling to avoid waiting after the HTTP call.

  • Updated Device Resolution string.

v2.6.5

  • Device & Network Information fixes

  • Fixed Player Resolution

  • Preload field addition

  • App Session Id field addition

  • Fix to consider Exit in Buffering

Last updated