For those of you who have been clamoring for a way to modify the Roku SDK videoplayer example to support additional category levels in the XML files, I have put together an example channel which does just that. I called it NewVideoPlayer because I couldn't think of a better name.
The code is available on GitHub:
https://github.com/belltown/Roku-NewVideoPlayer. There's an example categories.xml and feed.xml file to get you started with a few random feeds. There's a Private Channel using the example feeds here:
https://my.roku.com/account/add?channel=NEWVIDEOPLAYERRather than modify the Roku example channel, I started from scratch; it seemed easier that way. You should be able to just substitute your own XML files, which can be read from your package file or a remote url. There are a few other features I added (Play/Resume for the last 10 videos played, Play All, Play from Beginning, etc.) In addition to using the type of feed files used by the Roku SDK example, this code supports RSS feeds with MRSS and iTunes extensions. There's also code included to display feeds in an roGridScreen instead of an roPosterScreen.
Here's a list of supported features from the README file:
- Unlimited <category> levels, each displayed using an roPosterScreen.
The lowest <category> having <categoryLeaf> elements is displayed as an roPosterScreen with a filter banner.
An roGridScreen can be used instead of the roPosterScreen with a filter banner, by changing 2 lines of code.
All <category> and nested <category> elements must be specified in the top-level Xml file.
Each <categoryLeaf> must refer to a separate <feed> file containing the feed's <item> elements.
- The top-level Xml file may also be a Roku <feed> file, or an <rss> file.
- RSS files may contain RSS 2.0 elements, MRSS extensions, and iTunes extensions.
Note: The RSS/MRSS/iTunes extensions are ONLY supported in an <rss> feed, NOT in a Roku <feed>.
- A "feed" attribute may be specified for a <category> element, only if there are no subordinate <categoryLeaf> elements.
- A Roku feed (but not an RSS feed) may appear inline in the top-level Xml file,
subordinate to a <categories> or <category> element, but not a <categoryLeaf>.
- Xml files may be referenced either using a local Roku filename or a remote url (http or https).
- Xml element and attribute names are case-insensitive.
- See pkg:/xml/categories.xml and pkg:/xml/feed.xml for example feeds.
- See RokuFeed.brs for a list of supported Xml elements for a Roku feed.
- See Mrss.brs for a list of supported MRSS elements for an RSS feed.
- See Itunes.brs for a list of supported iTunes elements for an RSS feed.
- Supports Play/Resume, as well as 'Play all' and 'Play from beginning'.
- The last play position for the previous 10 videos played is stored for 'Resume' functionality.
- Should work on an SD TV, even if no SD streams are specified in the Xml feed file.
- Supports both MP4 and HLS video streams.
- Supports 'https' video and image urls.
- Compatible with the Xml files used by the Roku SDK videoplayer example (TED Talks Videos).
- Should work on all Roku firmware versions, including legacy 3.1 firmware.