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?