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.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Roku Smart TV - LabelList not showing

I am submitting a Roku channel, and it is continually rejected because the "Play" button doesn't show up on the Springboard.
I used one of the templates for the base code. It puts the "Play" button on screen using a LabelList. It works perfectly fine on the device I test on, which is a Roku stick. They seem to be testing these on a Roku Smart TV though, and something about that device is preventing the LabelList from showing.

Below is the code the adds the content to the LabelList.

Sub OnContentChange()
    content =
    m.description.content = content
    m.description.Description.width = "770"
    m.poster.uri = content.hdBackgroundImageUrl
    m.background.uri = content.hdBackgroundImageUrl

   m.buttonArray = []

    moviePlaysSection = CreateObject("roRegistrySection", "MoviePlays")
    if moviePlaysSection.Exists(content.guid)
        m.currentPosition = StrToI(moviePlaysSection.Read(content.guid))
    end if

    if content.url <> ""
        m.buttonArray.push({ title : "Play" })
    end if

    if content.trailerUrl <> invalid
        m.buttonArray.push({ title : "Play Trailer" })    
    end if

    m.buttons.content = ContentList2SimpleNode(m.buttonArray)
End Sub

Function ContentList2SimpleNode(contentList as Object, nodeType = "ContentNode" as String) as Object
    result = createObject("roSGNode",nodeType)
    if result <> invalid
        for each itemAA in contentList
            item = createObject("roSGNode", nodeType)
        end for
    end if
    return result
End Function

Is there something weird about the Roku Smart TV that prevents LabelLists from displaying or am I doing something wrong?
0 Kudos

Re: Roku Smart TV - LabelList not showing

It turns out that on older Roku firmware, you can't create instances of the roRegistrySection in the main thread. Therefore, you have to wrap interactions with it in a Task. I was using a newer firmware version where accessing it in the main thread isn't an issue. However, the Roku tester was using the previous version, where this was an issue. I hope this helps someone.
0 Kudos