Skip to main content

Maestro Panel SDK for Roku

Introduction

This document provides instructions on how to integrate the Roku Component Library into your application and utilize the MaestroPanel functionalities.

Installation Instructions

To install the MaestroKit component library, follow these steps:

Create a ComponentLibrary Node in your Roku application with the applicable sdk version url:

Update the below url to retrieve the sdk version desired.

https://roku-sdk.us-central1-master.gcp.maestro.io/{SDK_VERSION}/maestrokit.zip

m.componentLibrary = createObject("rosgNode", "ComponentLibrary")
m.componentLibrary.uri = "https://roku-sdk.us-central1-master.gcp.maestro.io/1.1.0/maestrokit.zip"
m.componentLibrary.observeField("loadStatus", "onLibraryLoadStatusChanged")

Load the Library and Instantiate the Maestro Panel

if (m.componentLibrary.loadStatus = "ready")
m.lib = createObject("rosgNode", "MaestroPanelLib:MaestroPanel")
m.lib.observeField("selectedClipIndex", "onSelectedClipIndex")
m.lib.observeField("focusedClipIndex", "onFocusedClipIndex")
m.lib.observeField("focusedTabItem", "onFocusedTabItem")
m.top.appendChild(m.lib)
end if

MaestroPanel Exposed Interfaces

The MaestroPanel provides multiple exposed interfaces for interaction:

Fields

1-focusedTabItem (Integer) - Returns the current selected tab index when focus moves between tabs.

2-focusedClipIndex (Integer) - Returns the index of the currently focused clip item in the key play list.

3-selectedClipIndex (Integer) - Returns the index of the currently selected clip item in the key play list.

Configurable Fields

Field ID Type Description

width Integer Sets the width of the panel

height Integer Sets the height of the panel

keyPlaysData AssocArray App can set key play data by passing an associative array

showPanel Boolean true to show the panel, false to hide it

playClip Integer Used to trigger clip playback by specifying the clip index

didUpdatePlaybackProgressOfClip AssocArray Tracks playback progress updates { index: [clip index], progress: [video progress] }

Example Usage

Setting Panel Size

m.lib.width = 1280
m.lib.height = 720

Displaying the Panel

m.lib.showPanel = true

Listening for Tab Focus Changes

function onFocusedTabItem(event as Object)
print "Current Focused Tab Index: " + event.getData()
end function

Tracking Playback Progress

function OnDidUpdatePlaybackProgressOfClip(event as Object)
progressData = event.getData()
print "Clip Index: " + progressData.index + " Progress: " + progressData.progress
end function