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

RoVideoScreen not loading video

I have a Roku application that is given links to a video through the launch command. This video is then displayed in a `roVideoScreen` object. However, the video just doesn't load. Assuming all the links work can anyone see what is going wrong. Any help is appreciated.

count = CreateObject("roInt")
count = info.Lookup("amount").ToInt()

bitrates = CreateObject("roArray", count, false)
qualities = CreateObject("roArray", count, false)
url = CreateObject("roArray", count, false)
StreamFormat = "mp4"
title = info.Lookup("title")

index = 0

if info.DoesExist("720") = true

url = info.Lookup("720")
bitrates.Push(2500)
qualities.Push("HD")
index = index + 1
end if

if info.DoesExist("480") = true

url = info.Lookup("480")
bitrates.Push(1200)
qualities.Push("SD")
index = index + 1
end if

if info.DoesExist("360") = true

url = info.Lookup("360")
bitrates.Push(700)
qualities.Push("SD")
index = index + 1
end if

if info.DoesExist("240") = true

url = info.Lookup("240")
bitrates.Push(380)
qualities.Push("SD")
index = index + 1
end if

videoclip = CreateObject("roAssociativeArray")
videoclip.StreamBitrates = bitrates
videoclip.StreamQualities = qualities
videoclip.StreamUrls = url
videoclip.StreamFormat = StreamFormat
videoclip.Title = title

video = CreateObject("roVideoScreen")
port = CreateObject("roMessagePort")
video.SetMessagePort(port)

video.SetContent(videoclip)

video.Show()
while true

end while
0 Kudos
2 REPLIES 2
RokuMarkn
Visitor

Re: RoVideoScreen not loading video

For one thing, you are setting url, and thus videoclip.StreamUrls, to a string rather than an array. You initially create an array for it but then you replace the array with a string rather than pushing the string onto the array.

--Mark
0 Kudos
Dan13_
Visitor

Re: RoVideoScreen not loading video

Yep that fixed it I just had to change the lines like ("url = info.Lookup("720")") to ("url.SetEntry(index,info.Lookup("480"))")
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.