Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
Showing results for 
Search instead for 
Did you mean: 
Level 7

I'm trying to play 3 files off of a USB stick in a row

Can I get some help figuring out why this example from the manual won't compile? thanks!!

Function showVideoScreen(episode As Object)
if type(episode) <> "roAssociativeArray" then
print "invalid data passed to showVideoScreen"
return -1
port = CreateObject("roMessagePort")
screen = CreateObject("roVideoScreen")
' Note: HDBranded controls whether the "HD" logo is displayed for a
' title. This is separate from IsHD because its possible to
' have an HD title where you don't want to show the HD logo
' branding for the title. Set these two as appropriate for
' your content
episode.HDBranded = false
episode.IsHD = false
' Note: The preferred way to specify stream info in v2.6 is to use
' the Stream roAssociativeArray content meta data parameter.
episode.Stream = { url:"",
episode.StreamFormat: "mp4"
' now just tell the screen about the title to be played, set the
' message port for where you will receive events and call show to
' begin playback. You should see a buffering screen and then
' playback will start immediately when we have enough data buffered.
' Wait in a loop on the message port for events to be received.
' We will just quit the loop and return to the calling function
' when the users terminates playback, but there are other things
' you could do here like monitor playback position and see events
' from the streaming player. Look for status messages from the
' player for status and failure events that occur during playback
while true
msg = wait(0, port)

if type(msg) = "roVideoScreenEvent" then
print "showVideoScreen | msg = "; msg.GetMessage() " | index
= "; msg.GetIndex()
if msg.isScreenClosed()
print "Screen closed"
exit while
else if msg.isStatusMessage()
print "status message: "; msg.GetMessage()
else if msg.isPlaybackPosition()
print "playback position: "; msg.GetIndex()
else if msg.isFullResult()
print "playback completed"
exit while
else if msg.isPartialResult()
print "playback interrupted"
exit while
else if msg.isRequestFailed()
print "request failed – error: "; msg.GetIndex();" –
"; msg.GetMessage()
exit while
end if
end if
end while
End Function

Sub Main()
m.verbose = false
m.port = CreateObject("roMessagePort")
m.filesystem = CreateObject("roFilesystem")
anepisode = CreateObject("roAssociativeArray")
End Sub
0 Kudos