【问题标题】:Roku Smart TV - LabelList not showingRoku 智能电视 - LabelList 未显示
【发布时间】:2018-02-03 22:16:58
【问题描述】:

我正在提交一个 Roku 频道,但由于 Springboard 上没有显示“播放”按钮,它不断被拒绝。

我为基本代码使用了其中一个模板。它使用 LabelList 将“播放”按钮放在屏幕上。它在我测试的设备上运行良好,这是一个 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 的显示,还是我做错了什么?

【问题讨论】:

  • content.url &lt;&gt; "" 是否会在任何时候为假?也许与 QA 期间可用的内容有关?否则我看不出代码有什么问题。

标签: roku brightscript


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-10-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多