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

RoVideoScreen is not working

Can someone tell me why the rovideoscreen is not working. I have a manifest, source which has the main.brs file inside it, and images

This is the only thing I have in the source/main.brr file
Sub Main()
screen = CreateObject("roVideoScreen")
screen.SetContent({
Title: "My Video"
StreamFormat: "hls"
Stream: { URL: "http://ec2-184-72-239-149.compute-1.amazonaws.com:1935/demos/smil:bigbuckbunnyiphone.smil/playlist.m3u8"}
})
screen.Show()
End Sub


Can someone tell me what needs to be added "the code needed" to make this play

And if I use the "roVideoPlayer" will the coding be the same or will it change
0 Kudos
5 REPLIES 5
RokuChris
Roku Employee
Roku Employee

Re: RoVideoScreen is not working

Because you don't have an event loop, your channel is exiting before the video can be played. You need to add an event loop after screen.Show(). Check out some of the sample channels to see how an event loop works.
0 Kudos
jseigle85
Visitor

Re: RoVideoScreen is not working

Do you have to use the eventloop for every application that use roVideoScreen and roVideoPlayer.

Also other than the BrightScript Reference is there a manual that have all of the coding for each component.

Can you provide me with a example of how to add an eventloop to this code. I am not understanding how it works in the example.
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: RoVideoScreen is not working

The Component Reference in the SDK documents all the available components.

Event loops are how your channel catches and reacts to events generated by the user and by the components within your channel, so yes, they are a very important part of any channel. A very minimal event loop might look like this:

while true
msg = Wait(0, port) ' where port is a roMessagePort
if type(msg) = "roVideoScreenEvent"
if msg.isScreenClosed()
exit while
end if
end if
end while
0 Kudos
jseigle85
Visitor

Re: RoVideoScreen is not working

Thank you the code works great, but I have one more problem with it. After the stream has stop playing it exit out to the Roku Menu. Is there a way I can make it go back to a loading status or do I have to use roVideoPlayer for that
0 Kudos
stratcat96
Visitor

Re: RoVideoScreen is not working

"jseigle85" wrote:
Thank you the code works great, but I have one more problem with it. After the stream has stop playing it exit out to the Roku Menu. Is there a way I can make it go back to a loading status or do I have to use roVideoPlayer for that



Try putting in a springboard that when the channel is clicked on goes straight to that with the option then to play the stream and display the videoscreen. When you back out of the stream or it finishes, it returns to the springboard with the ability to restart. That actually is the structure of the simple video player example. It's jumping back to the main menu because there's no object to fall back on after the videoscreen is exited
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.