Forum Discussion

bmckim's avatar
bmckim
Visitor
15 years ago

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?
  • 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