Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
TDave00
Visitor

Modifiying the videoplayer example to include videos.

I like how the videoplayer example populates a list of categories and videos. I can use that example to build my channel, but I was wanting to include a livestream video in line with the categories (on the main page) so that the user doesn't have to unnecessarily select the livestream category and then select the livestream subcategory and then select the video.

Can anyone point me in the right direction about how to implement this. I would like to be able to include the livestream details in the categories.xml file (specialCategory???). Is this something that would have to coded from scratch or are there any examples/templates out there for doing this?
0 Kudos
1 REPLY 1
joetesta
Roku Guru

Re: Modifiying the videoplayer example to include videos.

I don't know of any examples like this, but if you start with the categoryFeed.brs from the videoplayer example, you could use the specialCategory or you could hard-code / hack it as I did, so we don't need to put this in the XML (since our same XML is used elsewhere without this custom "Search" category) I believe you'd have to add the video's meta data to the category feed "o" object in your case here,

            ' Insert custom search button after category titled 'Favorite'
if(o.Title) = "Favorite" then
' Create the Search button
o = init_category_item()
o.Type = "normal"
o.Title = "Title Search"
o.Description = "Search by title"
o.ShortDescriptionLine1 = "Search Titles"
o.ShortDescriptionLine2 = "Search by Title"
o.SDPosterURL = "http://myURL.com/titles.png"
o.HDPosterURL = "http://myURL.com/titles.png"
o.Feed = ""
' add Title Search as the next button
topNode.AddKid(o)

Or if you do use the specialCategory, you'd have to update the category parse routine to handle the video meta data, which to me seems like a mess at first thought.


Then in appHomeScreen under displayCategoryPosterScreen I have something like:
  if category.Title = "Title Search" then
'print "Display Title Search screen now"
showTitleSearchScreen()
return 0


Then there is a function showTitleSearchScreen that I needed to create, but using the meta data loaded above, you would play the video instead of calling showTitleSearchScreen under displayCategoryPosterScreen.

I hope this might be of some help!
-Joe
aspiring
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.