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: 
jeremyk
Visitor

Videoplayer sample app with only one category of content?

Does anyone have any guidance on basically removing the category functionality from the sample video player app? So you load the channel and its just straight to the video listing? Basically it might look like MRSS, but not based on some RSS feed out there. You see, I will be adding categorization in the future as new content becomes available, but to start there is only one category and seems silly to just have the one there (extra action from the user). I would rather not rip it all out and would rather trick it into moving straight to a particular categories listing, then can always add it back later.

Thanks for any help.
0 Kudos
5 REPLIES 5
RokuJoel
Binge Watcher

Re: Videoplayer sample app with only one category of content

I believe this code is in Videoplayer in the current 4.1 release of the SDK, note the part starting with "temp=getcategorylist"

Function showPosterScreen(screen As Object, category As Object) As Integer

if validateParam(screen, "roPosterScreen", "showPosterScreen") = false return -1
if validateParam(category, "roAssociativeArray", "showPosterScreen") = false return -1

m.curCategory = 0
m.curShow = 0
temp=getcategorylist(category)


if temp.count() > 1 then
screen.SetListNames(temp)
?temp.count();" categories"
else
?"only ";temp.count();" category"
end if
screen.SetContentList(getShowsForCategoryItem(category, m.curCategory))
screen.Show()

while true
0 Kudos
jeremyk
Visitor

Re: Videoplayer sample app with only one category of content

Great, I will get the latest and check it out. Thanks!
0 Kudos
jeremyk
Visitor

Re: Videoplayer sample app with only one category of content

So I tried this out generically just to see what would happen and the sample code seems to crash if you only have one category. First it does show the category screen and then if you select the category screen, it immediately throws errors in the debugger.
0 Kudos
RokuJoel
Binge Watcher

Re: Videoplayer sample app with only one category of content

it's a code excerpt, the code that matters is

temp=getcategorylist(category)
if temp.count() > 1 then
screen.SetListNames(temp)
?temp.count();" categories"
else
?"only ";temp.count();" category"
end if


Post your crash details.

- Joel
0 Kudos
jeremyk
Visitor

Re: Videoplayer sample app with only one category of content

Yeah, I think understand the code. That being said, if I am not mistaken isn't this on the wrong screen to bypass the Category page? Shouldn't we actually be implementing similar code on appHomeScreen.brs? This was the area I was expecting to add code. Prior to screen.Show() being called...


Function showHomeScreen(screen) As Integer

if validateParam(screen, "roPosterScreen", "showHomeScreen") = false return -1

initCategoryList()
screen.SetContentList(m.Categories.Kids)
screen.SetFocusedListItem(3)
screen.Show()


Maybe I am not understanding the flow properly, but isn't appPosterScreen showing the videos FROM a selected category so that code doesn't even fire until a category is selected? I am trying to skip the category selection page and jump right to the associated videos for a category.
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.