Blackhawk
6 years agoRoku Guru
springboard error
Im working on getting my channel to run with ads
' ********** Copyright 2016 Roku Corp. All Rights Reserved. ********** ' 1st function that runs for the scene component on channel startup sub init() 'To see print statements/debug info, telnet on port 8089 m.Image = m.top.findNode("Image") m.Details = m.top.findNode("Details") m.Title = m.top.findNode("Title") m.Video = m.top.findNode("Video") m.SpringDetails = m.top.findNode("SpringBoardDetails") m.LabelList = m.top.findNode("LabelList") m.CategoryLabel = m.top.findNode("CategoryLabel") m.RuntimeLabel = m.top.findNode("RuntimeLabel") m.Video.ObserveField("state","OnVideoPlayerStateChange") m.Title.font.size = 40 m.CategoryLabel.color = "#333333" m.Title.color = "#333333" m.Details.color = "#444444" m.RuntimeLabel.color = "#333333" end sub ' set proper focus to buttons if Details opened and stops Video if Details closed Sub onVisibleChange() ? "[DetailsScreen] onVisibleChange" if m.top.visible = true then m.buttons.jumpToItem = 0 m.buttons.setFocus(true) else if m.videoPlayer <> invalid m.videoPlayer.visible = false m.videoPlayer.control = "stop" m.poster.uri="" m.background.uri="" end if End Sub ' set proper focus to Buttons in case if return from Video PLayer Sub OnFocusedChildChange() if m.top.isInFocusChain() and not m.buttons.hasFocus() and not m.videoPlayer.hasFocus() then m.buttons.setFocus(true) end if End Sub ' set proper focus on buttons and stops video if return from Playback to details Sub onVideoVisibleChange() if m.videoPlayer.visible = false and m.top.visible = true m.buttons.setFocus(true) m.videoPlayer.control = "stop" 'clear video player content, for proper start of next video player m.videoPlayer.content = invalid 'remove video player m.top.removeChild(m.videoPlayer) end if End Sub ' event handler of Video player msg Sub OnVideoPlayerStateChange() if m.videoPlayer.state = "error" ' error handling m.videoPlayer.visible = false else if m.videoPlayer.state = "playing" ' playback handling playContent() else if m.videoPlayer.state = "finished" m.videoPlayer.visible = false end if End Sub sub playContent() content = m.buttons.content if content <> invalid then m.video.content = content m.video.visible = false m.PlayerTask = CreateObject("roSGNode", "PlayerTask") m.PlayerTask.observeField("state", "taskStateChanged") m.PlayerTask.video = m.video m.PlayerTask.control = "RUN" end if end sub sub taskStateChanged(event as Object) print "Player: taskStateChanged(), id = "; event.getNode(); ", "; event.getField(); " = "; event.getData() state = event.GetData() if state = "done" or state = "stop" exitPlayer() end if end sub ' on Button press handler Sub onItemSelected() ' first button is Play if m.top.itemSelected = 0 m.videoPlayer = CreateObject("roSGNode", "Video") m.videoPlayer.id="videoPlayer" m.videoPlayer.translation="[0, 0]" m.videoPlayer.width="1280" m.videoPlayer.height="720" m.videoPlayer.content = m.top.content 'show video player m.top.AppendChild(m.videoPlayer) m.videoPlayer.visible = true m.videoPlayer.setFocus(true) m.videoPlayer.control = "play" m.videoPlayer.observeField("state", "OnVideoPlayerStateChange") m.videoPlayer.observeField("visible", "onVideoVisibleChange") end if End Sub ' Content change handler Sub OnContentChange() m.description.content = m.top.content m.description.Description.width = "770" m.poster.uri = m.top.content.hdBackgroundImageUrl m.background.uri = m.top.content.hdBackgroundImageUrl End Sub '///////////////////////////////////////////' ' Helper function convert AA to Node 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 Function OnkeyEvent(key, press) as Boolean ? ">>> Details >> OnkeyEvent" result = false if press AND key = "back" AND m.videoPlayer <> invalid AND m.videoPlayer.visible m.videoPlayer.visible = false result = true end if return result End Function
Yet I keep getting these errors
Invalid value for left-side of expression. (runtime error &he4) in pkg:/components/SpringBoard.brs(117) 117: m.description.content = m.top.content