This is a sample Roku channel utilizing the THEOplayerSDK and connectors. THEOplayerSDK is a custom component allowing channel developers to easily embed the THEOplayer in a channel. The channel presents a list of media to play using the THEOplayerSDK with the default, slightly customized Roku Video UI.
componentscontains all the components of basic playback reference application.imagesdirectory contains the channel artworks.sourcedirectory contains themain.brsfile, a starting point for the Roku channel.manifestfile is required by the Roku platform, contains the configuration of the Roku channel.README.mdfile is available in root folder.package.shoptional build script to make deploying easier
- Install an IDE, preferably VSCode with Brightscript extensions.
- Connect the Roku device and turn on the developer mode: https://blog.roku.com/developer/developer-setup-guide in order to sideload the application zip onto the device.
- Clone the reference app repository - https://github.com/THEOplayer/samples-roku-sdk.
- Paste the THEOplayer license in the chosen reference application files instead of the placeholder:
m.player.callFunc("configure", { license: "<MY_THEO_LICENSE>" })
- If using Conviva, paste your client key in the THEOConvivaConnector
configurecall incomponents/VideoPlayerView.brs. If you are testing and not doing production, also add your gateway URL and you may also enable Conviva debug. If doing production, remove thegatewayUrlanddebugparameters.m.convivaConnector.callFunc("configure", m.player, "<MY_CUSTOMER_KEY>", "<MY_GATEWAY_URL>", true) - If using Comscore, paste your publisher ID and secret in the configuration object passed to the THEOComscoreConnector
configurecall incomponents/VideoPlayerView.brs.comscoreConfig = { publisherId: "<MY_PUBLISHER_ID>", publisherSecret: "<MY_PUBLISHER_SECRET>", applicationName: "THEO Roku Reference Sample App" } m.comscoreConnector.callFunc("configure", m.player, comscoreConfig)
- If you would like to add your own content and metadata to the app, modify
components/configs/Content.brs.
To manually deploy the app
- Go to
reference-test-app/and zip all the folders and files (except forbuild/,package.sh,README.mdandRELEASE.md). - Go to the Roku device IP address in a browser. When prompted, type in the Roku developer username and password for that device.
- Make sure you are in the Installer tab (top right corner), and upload the zip file, then click the replace or install button.
To use a script to deploy the app
- If you haven't already, create a file called
env.shin the root of the project. The file should have the following vars defined:
export ROKU_HOST=<MY_ROKU_IP>
export ROKU_USERPASS=<MY_ROKU_PASSWORD>- If you're on Windows and do not have the
zipapplication installed, you can also use7zipif you have it installed by adding the following variable in yourenv.shfile:export ZIP_TOOL=7zip - In a CLI, navigate to the
reference-test-appdirectory and run the command./package.sh. The script will package and deploy the app to your Roku. On subsequent runs, all that is needed is to rerun./package.sh
To use VS Code to deploy the app
- Install the Brightscript Language extension
- In the
.vscodedirectory, create a file calledvariables.env - In
variables.envadd your Roku's IP and password:
ROKU_IP=<MY_ROKU_IP>
ROKU_PASSWORD=<MY_ROKU_PASSWORD>
- In VS Code's Run and Debug panel, select
Debug: reference-test-appand click the play icon next to it. VS Code will package the app and deploy it to your Roku, additionally starting a debug session for your app.