Does anyone know how I can show the status of a live stream on a website? Currently when you go to your website and click Watch live, you get a player box that just shows a spinner and nothing shows when there is not a live broadcast. I would like to detect the status of a live stream and put up a graphic or something to show it is not on. I am on a Windows box. Is there a way just do do an http call or something to determine this?
If like me you can’t make heads nor tails of the post above, I found a kind of workaround using PHP. If you have enabled cupertino streaming, you can read the contents of the generated .m3u8 with file_get_contents()
Then, you can see some differences if the stream is actually active or not. I’m not sure it will be 100% the same for everyone, but in my case, an active stream will show resolution information, while a “dead” one will not. So, this is what I use:
The problem with this approach, it takes about 10 seconds to get a result. So if you have a bunch of channels and want to check them all at once, you’ll probably run into PHP timeout issues.
And yes, I know it’s pretty nasty, and may not work for everyone, but it’s the most direct way I could find for doing this