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

HLS offline detection

So I've gotten HLS to work with my roku box, and have figured out how to write and encode it using the XML file. But i'm trying to write an if statement to detect when the HLS stream is offline with something like isStreamStarted() or perhaps with isRequestFailed() so something like:

if isRequestFailed() = -5
print "The stream is currently offline"
end if

Would this work? If so, where and which Source file would you recommend this being placed?
We're using the video player template for our channel.

When i'm connected to the debugging console - and I click on one of the offline HLS streams it gives me the output of

"ButtonPressed
showHomeScreen | msg = ConnectionContext failure | index = 0
Video status: 0 0
showHomeScreen | msg = Unspecified or invalid track path/url. | index = 0
Video status: 0 0
showHomeScreen | msg = | index = -5
Video request failure: -5 1
showHomeScreen | msg = | index = 0
Screen closed"

If you need to see the code, I can post that as well, but I haven't made many changes from the original Video player template.
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.