sub showChannelSGScreen(contentid, screen)
port = CreateObject("roMessagePort")
screen = CreateObject("roSGScreen")
m.global = screen.getGlobalNode()
m.global.addfield("vidid","string",FALSE)
m.global.vidid = contentID
screen.setMessagePort(port)
scene = screen.CreateScene("VideoExampleScene")
screen.show()
while(true)
print "in while loop"
msg = wait(0, port)
msgType = type(msg)
'print msg '
if msgType = "roSGScreenEvent"
print "showHomeScreen | msg = "; msg.getMessage() " | index = "; msg.GetIndex()
if msg.isScreenClosed()
print "Screen closed"
return
else if msg.isRequestFailed()
print "Video request failure: "; msg.GetIndex(); " " msg.GetData()
else if msg.isFullResult()
print "Playback completed"
else if msg.isStatusMessage()
print "Video status: "; msg.GetIndex(); " " msg.GetData()
else if msg.isButtonPressed()
print "Button pressed: "; msg.GetIndex(); " " msg.GetData()
else if msg.isPlaybackPosition() then
nowpos = msg.GetIndex()
RegWrite(episode.ContentId, nowpos.toStr())
else
print "Unexpected event type: "; msg.GetType()
nowpos = msg.GetIndex()
print "Current position: "; nowpos.ToStr()
RegDelete(episode.contentId)
end if
else
'print "Unexpected message class: "; type(msg) '
end if
end while
end sub
screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
screen.setMessagePort(m.port)
if contentid <> invalid
m.vidd = contentid
else
m.vidd = ""
end if
m.global = screen.getGlobalNode()
m.global.id = contentid
m.global.addFields( {id: contentid} )
scene = screen.CreateScene("VideoExampleScene")
screen.show()
while(true)
print "in while loop"
msg = wait(0, m.port)
msgType = type(msg)
print "msg"
print msg
print msgType
if msgType = "roSGScreenEvent"
print "showHomeScreen | msg = "; msg.getMessage() " | index = "; msg.GetIndex()
if msg.isScreenClosed()
print "Screen closed"
return
else if msg.isRequestFailed()
print "Video request failure: "; msg.GetIndex(); " " msg.GetData()
else if msg.isFullResult()
print "Playback completed"
else if msg.isStatusMessage()
print "Video status: "; msg.GetIndex(); " " msg.GetData()
else if msg.isButtonPressed()
print "Button pressed: "; msg.GetIndex(); " " msg.GetData()
else if msg.isPlaybackPosition() then
nowpos = msg.GetIndex()
RegWrite(episode.ContentId, nowpos.toStr())
else
print "Unexpected event type: "; msg.GetType()
nowpos = msg.GetIndex()
print "Current position: "; nowpos.ToStr()
RegDelete(episode.contentId)
end if
else
print "Unexpected message class: "; type(msg)
end if
end while
We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. Read more here.
Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 19th and you may notice reduced functionality.
In the meantime, for additional assistance, visit our Support Site.
We're sorry for this disruption — we’re excited to share what’s next!