我正在提交一个Roku频道,但它不断被拒绝,因为“播放”按钮没有显示在跳板上。
我对基本代码使用了其中一个模板。它使用LabelList将“播放”按钮放在屏幕上。在我测试的Roku stick设备上,它工作得非常好。他们似乎是在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的显示,还是我做错了什么?
发布于 2018-02-03 22:16:59
问题最终是我试图访问主线程中的Roku注册表。低于8的Roku版本不允许这样做。您必须在Task中访问它。代码在我的运行版本8的硬件上运行得很好。Roku测试它的硬件运行的是版本7。简单的修复,但如果没有正确的硬件很难追踪到。
https://stackoverflow.com/questions/47743908
复制相似问题