Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
SkipFire
Visitor

roVideoScreen seems to freeze

I have an roVideoScreen that is loading and seems to hang when it waits on a new message. I have verified the URL going in is valid [using Print urls.GetEntry(0)] and in my code I get the "in while loop" in telnet but nothing past that. The TV shows "retrieving" and never shows any progress on the progress bar. The remote buttons also don't seem to do anything and I have to hit the home button to exit all the way out as the back button doesn't work.

I'm sure I've missed something simple, but I would appreciate some help.


Sub ShowVideoScreen(StartPosition As Integer)
port = CreateObject("roMessagePort")
screen = CreateObject("roVideoScreen")
episode = CreateObject("roAssociativeArray")
episode.HDBranded = false
episode.IsHD = false
urls = CreateObject("roArray", 0, True)
urls.Push(m.CurrentVideo.URL)
Print urls.GetEntry(0)
episode.StreamUrls = urls
episode.StreamFormat = "mp4"
screen.SetContent(episode)
screen.SetMessagePort(port)
screen.Show()
print "before the while loop"
while true
Print "in while loop"
msg = wait(0, screen.GetMessagePort())
print type(msg)
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
print "after the while loop"
End Sub
0 Kudos
7 REPLIES 7
destruk
Streaming Star

Re: roVideoScreen seems to freeze

You're missing a streambitrate, and streamqualities (SD/HD)
It's annoying that roku won't provide an error message for required content metadata that is missing. It will just stupidly sit there like this if you're missing something it needs to initiate playback.
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: roVideoScreen seems to freeze

Best practice is to use the newer stream attributes of the content-meta-data rather than the old parallel arrays.

http://sdkdocs.roku.com/display/sdkdoc/ ... +Meta-Data

video = {
streamFormat: "mp4"
streams: [
{ url: "http://www.example.com/500.mp4", bitrate: 500, quality: false }
{ url: "http://www.example.com/1000.mp4", bitrate: 1000, quality: false }
{ url: "http://www.example.com/1500.mp4", bitrate: 1500, quality: true }
' etc
]
}
0 Kudos
SkipFire
Visitor

Re: roVideoScreen seems to freeze

Well, that's annoying and problematic. I don't know what the bitrate is and there is only one stream. I'll just set it to the max known bit rate regardless of what the actual bitrate will be and see if that works I guess.
0 Kudos
SkipFire
Visitor

Re: roVideoScreen seems to freeze

It does seem to work even when the bitrate isn't even close to the video's bitrate.
0 Kudos
RokuJoel
Binge Watcher

Re: roVideoScreen seems to freeze

I would think setting a zero bitrate would be better. If there is only one bitrate stream, then you can load it in Quicktime or in VLC and get the average bitrate there.

- Joel
0 Kudos
SkipFire
Visitor

Re: roVideoScreen seems to freeze

Right now there are over 3000 video files it may pull, with more being added frequently. Most of them will be about 2650, 3950, or 5200, but I think I saw one as low as 900. None of the videos are multi-streamed, so hopefully it just never becomes an issue.
0 Kudos
RokuJoel
Binge Watcher

Re: roVideoScreen seems to freeze

Typically people will use various command line tools to build up some meta data about each video and store it in a file or in a database so that they can generate the proper metadata for each video in their library when it is needed. There are also probably some commercial tools that do this as well.

- Joel
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.