Forum Discussion

jeremyk's avatar
jeremyk
Visitor
14 years ago

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.

5 Replies

  • 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
  • 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.
  • 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
  • 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.