I have been looking at this code and modifying for several hours and now my eyes are crossed. Any ideas why I cannot get events to print out? I'm sure it is something trivial.
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