#Roku Sample App for Brightcove This template provides a jump-start to getting your Brightcove content published on Roku.
To use the sample, you just need a Roku device that is set in "dev" mode:
- Using the Roku remote, press
Home-Home-Home-Up-Up-Right-Left-Right-Left-Right
- Choose to Enable the Installer
You only need to do this once, and then it will remain in dev mode.
To build and install the source, there's a Makefile that should take care of everything for you. You just need to set an environment variable with the IP address of your Roku. You can find the IP address in the Network settings on the device. Then to build and install:
export ROKU_DEV_TARGET=192.168.1.2
(substituting your IP address...)make install
Once complete, you should now see the Roku application running.
You may also want to set the DEVPASSWORD as an environment variable if you have a password set for your account. This will stop the prompt for a password in "make install".
If the above doesn't work, and the application is not showing up with 'make install', you can usually see what's going wrong in the Roku console. Dev channels are able to write messages to a console that you can tail using telnet. Accessing is as simple as:
telnet $ROKU_DEV_TARGET 8085
To start changing the sample, you should have two accounts:
The Roku developers account gives you access to the full SDK source, helpful forums, and information on publishing a finished channel. The Brightcove VideoCloud account will be used for editing the playlists and videos in use.
You can change a lot in the sample application without changing too much code. There's ways to change not only the content but also the images, text, and themes. Below are the files you can change and what to change in them.
- title: this is the name of the app that appears on the channel list
- subtitle: appears beneath the title on the channel list (optional)
- appName: this is the name of the application, appearing in the upper right corner of the app
- useSmartPlayer: whether to use a Smart Player or Brightcove Player to retrieve playlist and video information. Two sections below describe in detail the specific settings you need to then set for the player in use.
- alwaysShowPlaylists: if set to false, the app will not show the playlists screen if there is only one playlist. It will go straight to the video assets instead.
- initTheme settings: controls the look and feel of your application. This is well documented in the Roku SDK documents
The smart player is most people are using for their players in Brightcove (as of early 2015). If this is what you are used to using, you can set up one of these players for use with this application:
- Create a custom smart player using one of the multi-playlist player templates, and at least one playlist for your Roku content. You can add as many playlists as you'd like
- You can use a thumbnail for each playlist (304x237 pixels), or the poster image of the first video in the playlist will be used for the playlist thumbnail.
Once the above is set up, you can set up the player in source/Config.brs using the following settings:
- brightcoveToken: your Brightcove API key with read permission and URL access. This can be found in Account Settings > API Management in VideoCloud
- playerID: the player ID of the smart player you created
Brightcove players are the new player from Brightcove (as of early 2015). If you are using these players, you can also set one of them up for use with this application:
- Create a custom Brightcove player and make sure it is enabled for playlists. In the media module, find the playlist you would like to use with it. Copy the URL embed code for use.
Once the above is set up, you can set up the player in source/Config.brs using the following settings:
- playerURL: the URL as described above which has a playlist associated with it
Currently multiple playlists are not support in the Brightcove Player, and only one playlist is possible using this setup. There is nearly-completed code in source/BrightcovePlayerAPI.brs to allow for multiple playlists using a config specific for Roku. If you get this working, please send in a pull request!
Replace any of the following sample images with brand images:
- Overhang_Background_HD.png (header images that appear at the top of the screen)
- Overhang_Background_SD.png
- mm_icon_focus_hd.png
- mm_icon_focus_sd.png
- mm_icon_side_hd.png
- mm_icon_side_sd.png
A lot more is possible with Roku that this app doesn't do. Consider this just a starting point for your Roku experience! If you have changes you've made that you think are generally useful, we'd love to have them in here. Just open a pull request. If you are in need of a lot more that isn't provided here, you can always contact Brightcove's Global Services, which has made much more complicated Roku apps for customers.
As pretty much all Roku apps do, some of the code is from the Roku SDK. Files that are completely from the SDK can be found in source/roku-sdk.
Parts of the README were taken from https://github.com/plexinc/roku-client-public
SimpleJSON is thanks to "TheEndless" in the Roku forums.
And most importantly, all of the contributors you can see in github. Thank you!
Copyright (c) 2015 Brightcove Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.