首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Roku智能电视- LabelList未显示

Roku智能电视- LabelList未显示
EN

Stack Overflow用户
提问于 2017-12-11 05:58:56
回答 1查看 64关注 0票数 0

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

我对基本代码使用了其中一个模板。它使用LabelList将“播放”按钮放在屏幕上。在我测试的Roku stick设备上,它工作得非常好。他们似乎是在Roku智能电视上测试这些,但该设备的某些东西阻止了LabelList的显示。

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

代码语言:javascript
复制
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的显示,还是我做错了什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-02-03 22:16:59

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47743908

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档