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.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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)
End Sub

'** displayVideo()

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

videoclip = CreateObject("roAssociativeArray")
videoclip.StreamBitrates = [512]
videoclip.StreamUrls = [""]
videoclip.StreamQualities = ["SD"]
videoclip.StreamFormat = "hls"
videoclip.Title = "Live Stream"

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