So I think I figured out what my problem was. I was using example code from the example app (videoplayer) that is in the SDK (2.8 ). From the appVideo.brs file from that example:
Function showVideoScreen(episode As Object)
if type(episode) <> "roAssociativeArray" then
print "invalid data passed to showVideoScreen"
return -1
endif
port = CreateObject("roMessagePort")
screen = CreateObject("roVideoScreen")
screen.SetMessagePort(port)
screen.Show()
screen.SetPositionNotificationPeriod(30)
screen.SetContent(episode)
screen.Show()
'Uncomment his line to dump the contents of the episode to be played
'PrintAA(episode)
I used most of this code for my app. Taking out the first screen.Show() helped my issue. I think there is some kind of asynchronous behavior that may cause a race condition. So far I haven't need the sleep(3000) to keep it from erroring out again. For some reason, I only experienced this issue with the hls streamformat. It seems like it is possible to click play before the screen.SetContent() function has returned and this causes it to error out because there's no content set. Is this just an oversight in the example code or is it in there for a reason?
-Kaitlin