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

Controlling roVideoScreen Exiting

Does anyone know anything about how roVideoScreen handles errors? I am trying to get roVideoScreen to repeatedly attempt to access a live HLS stream from a Wowza server using this code:


Sub Main(args As Dynamic)
displayVideo("")
End Sub

'*************************************************************
'** displayVideo()
'*************************************************************

Function displayVideo(args As Dynamic)
p = CreateObject("roMessagePort")
video = CreateObject("roVideoScreen")
video.setMessagePort(p)

videoclip = CreateObject("roAssociativeArray")
videoclip.StreamBitrates = [512]
videoclip.StreamUrls = ["http://mystream.com/live/livestream.sdp/playlist.m3u8"]
videoclip.StreamQualities = ["SD"]
videoclip.StreamFormat = "hls"
videoclip.Title = "Live Stream"
video.SetContent(videoclip)

video_loop:
video.show()
msg = wait(0, video.GetMessagePort())

goto video_loop:

End Function


It plays fine if the stream is active when the app is started, but if the stream stops or is not active at the start, it just kicks back to the home screen. Instead, I want it to just keep trying to access the stream.

The debug terminal shows the following response to a halted stream:
"play failed: An unexpected problem (but not server timeout or HTTP error) has been detected."
...but no message if the stream is not present at the start.

Is there any way around this, or is this "return home" coming from lower level in Brightscript than I can access?
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.