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:
[upload|xfBoBe8i04eavRZ7yugeHA==]
Any thoughts on what is going on or why it won’t fully load?
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.
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.
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: