Skip to main content

Getting Started

Installing the SDK

Obtain the SDK package as a .zip file

Unzip the downloaded file to your local system using your preferred tool or the following command in the terminal:

unzip <sdk_file_name>.zip

Locate the extracted MaestroKit folder from the unzipped contents. Copy the entire folder into your app's components directory

Import SDK Elements

Add the required elements to your scene by including the OverlayElement and PanelElement components in your UI XML:

<!-- Initialize Panel Element -->
<MaestroPanel id="maestroPanel" />

Using the SDK

Note: The SDK should only be used within SceneGraph components. Calling it from the main thread or a Task component is not supported.

Here’s how you can initialize and use the SDK in your code:

Initialization

In the init function, find the elements and configure their behavior:

sub init()
' Initialize Panel Element
m.maestroPanel = m.top.findNode("maestroPanel")

m.maestroPanel.width = 513
m.maestroPanel.height = 1060
m.maestroPanel.config = { clientId: "664b9c57d59a7a431542d814", pageId: "66d9fd2b72fb66620df2acb8", userState: true, location: "USA", timeCode: "67686" }
m.maestroPanel.setFocus(true)

end sub

Key Points

Structure of Content: Make sure the content property is correctly structured based on your application’s requirements.

Error Handling: Always verify that m.panelElement and m.overlayElement are properly initialized before invoking any methods.

SceneGraph Compatibility: The SDK is designed specifically for SceneGraph components. Avoid using it in unsupported contexts to prevent runtime errors.

FAQ

  1. What should I do if m.panelElement or m.overlayElement is invalid?

Ensure the corresponding elements are defined in your XML file with the correct id. Verify that the IDs in your find method match the IDs in your XML. For example:

<MaestroPanel id="maestroPanel" />
<MaestroOverlay id="maestroOverlay" />
  1. Can I use the SDK in a Task component or the main thread?

No, the SDK is designed specifically for use in SceneGraph components. Using it elsewhere may lead to unexpected behavior or runtime errors.

  1. How do I set content for the panel or overlay?

The content property accepts structured data based on your application needs. Here’s a basic example:

m.maestroPanel.width = 513
m.maestroPanel.height = 1060
m.maestroPanel.config = { clientId: "664b9c57d59a7a431542d814", pageId: "66d9fd2b72fb66620df2acb8", userState: true, location: "USA", timeCode: "67686" }
  1. Why are the show and hide methods not working?

Ensure the following:

The elements are properly initialized using m.top.find().

The SDK is integrated correctly into your app’s components folder.

There are no typos in the method calls: callFunc("show") or callFunc("hide").

  1. What happens if the SDK is not working as expected?

Check the logs for errors using the Roku debugger.

Verify that the components/sdk folder is correctly placed and imported.

Confirm that the SDK is used in a SceneGraph component.