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

Detect when stream stops?

I have been doing some long run testing on the roku and find that after several hours ( anywhere from 12-48 ) various HLS streams will stop playing and the roku will just have a black screen. If I exit out and start the stream again it will fire back up. Is there anyway in a custom app to detect that a stream has stopped and to restart the app?
0 Kudos
1 REPLY 1
RokuKevin
Visitor

Re: Detect when stream stops?

You could use the roVideoScreen.SetPositionNotificationPeriod() method and monitor msg.isPlaybackPosition() events in your eventloop to know that you continue to make progress in your video stream.

You can also monitor error events via

syslog = CreateObject("roSystemLog")
syslog.SetMessagePort(port)
syslog.EnableType("http.error")
syslog.EnableType("http.connect")
syslog.EnableType("bandwidth.minute")

And watch for type(msg) = "roSystemLogEvent" events in your event loop to monitor more detail about playback errors.

--Kevin
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.