Roku Smart TV - LabelList 未显示

Roku Smart TV - LabelList not showing

我正在提交一个 Roku 频道,但它一直被拒绝,因为 "Play" 按钮没有出现在 Springboard 上。

我使用了其中一个模板作为基本代码。它使用 LabelList 将 "Play" 按钮放在屏幕上。它在我测试的 Roku 棒设备上运行良好。不过,他们似乎正在 Roku 智能电视上测试这些,但该设备的一些问题阻止了 LabelList 的显示。

下面是将内容添加到 LabelList 的代码。

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

    ' create buttons
    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)
            item.setFields(itemAA)
            result.appendChild(item)
        end for
    end if
    return result
End Function

Roku TV 是否有什么奇怪的地方阻止了 LabelLists 的显示,还是我做错了什么?

问题最终是我试图在主线程中访问 Roku 注册表。这在低于 8 的 Roku 版本中是不允许的。您必须改为在任务中访问它。该代码在我的 运行 版本 8 硬件上运行良好。Roku 对其进行测试的硬件是 运行 版本 7。修复简单,但如果没有正确的硬件则很难追踪。