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: 
jkard
Visitor

Video "gets stuck" when loading on roVideoScreen

Hey friends,

Hoping I'm doing something stupid on this. I have a test video hosted at Akamai, and am trying to get it to play via a roVideoScreen, but it gets "stuck" about 1/3 way when trying to load. It's a MP4 file and loads just fine in a browser.

Code

Function ShowVideoScreen(TitleArray As Object)

'Print to Debugger
Print("Initalize Video Screen - [ scr_VideoScreen.ShowVideoScreen() ]")

'Create Video Screen
video = CreateObject("roVideoScreen")

'Create Port
port = CreateObject("roMessagePort")

'Set The Port
video.SetMessagePort(port)

'Associative Array Of Video Values
aa_Video = CreateObject("roAssociativeArray")

'Set Video Attributes
aa_Video.Stream = {url:TitleArray.Lookup("streamURL")}
aa_Video.IsHD = true
aa_Video.Qualities = "HD"
aa_Video.HDBranded = true
aa_Video.StreamFormat = "mp4"
aa_Video.Title = TitleArray.Lookup("Title")

'Set Content To The Video Player
video.SetContent(aa_Video)

'Load And Show The Video
video.Show()

'Set Listener
while true

'Set Msg From Video
msg = Wait(0, video.GetMessagePort())

'Determine User Action
if type(msg) = "roVideoScreenEvent"
if msg.isScreenClosed()

'User Exited
exit while

end if
end if

end while

End Function


Image:


Any thoughts on what is going on or why it won't fully load?

Thanks
Jay

PS - Here is the link to the raw video http://assets.c2mx.com/95786e665c4944f5 ... 5B4600.mp4
0 Kudos
5 REPLIES 5
jbrave
Channel Surfer

Re: Video "gets stuck" when loading on roVideoScreen

There's nothing wrong with that file as far as I can see, tossed it into an existing project and it plays on my Roku.

Might want to set the bit rate in your aa_video.bitrate to the bitrate or to 0

also, it should be video.StreamQualities not video.Qualities, I think. Also, that is a very high bitrate, might want to go for something a bit lower, keeps rebuffering every few minutes on my 6mbit connection.

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
jkard
Visitor

Re: Video "gets stuck" when loading on roVideoScreen

Thanks Joel,

I'll adjust those settings, I kind of Frankensteined my code together from several examples, so I'm sure I missed something.

I took a look at the encode, and am seeing the same thing, I had not noticed that. I'll have our team re-encode to a proper bitrate and see if that helps.

Thanks a ton for the advice
Jay
0 Kudos
jbrave
Channel Surfer

Re: Video "gets stuck" when loading on roVideoScreen

Nothing wrong with the bitrate per se, you might want to have a few bitrates of the same video, store in an array so roku can auto-switch.

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
renojim
Community Streaming Expert

Re: Video "gets stuck" when loading on roVideoScreen

The video plays for me, but the audio is out of sync. I also see a lot of combing artifacts in the video.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: Video "gets stuck" when loading on roVideoScreen

This isn't the answer to your problem, but worth pointing out. There are two different ways to define your streams and you're sort of mixing them together. There's the stream(s) attribute approach and an older parallel arrays approach. When using the stream attribute, quality should be specified as a boolean attribute of the stream AA, not in a streamQualities array of strings. This is described in more detail in section 3.3 of the Component Reference.

Combining a stream AA containing a URL with a streamQualities array of strings, won't break anything necessarily, but your streamQualities will probably be ignored. What you really want to do is this:

aa_Video.Stream = {
url: TitleArray.Lookup("streamURL")
quality: true
}
0 Kudos