# Need to show status of live stream on website

**URL:** <https://community.wowza.com/t/need-to-show-status-of-live-stream-on-website/250>\
**Category:** Wowza Streaming Engine\
**Created:** [October 7, 2013, 9:56pm UTC](https://community.wowza.com/t/need-to-show-status-of-live-stream-on-website/250 "2013-10-07T21:56:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/system/32/447_2.png) [@system](https://community.wowza.com/u/system)\
**Post date:** [October 7, 2013, 9:56pm UTC](https://community.wowza.com/t/need-to-show-status-of-live-stream-on-website/250/1 "2013-10-07T21:56:34Z")

</div>

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?

Thanks

Chris

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [October 7, 2013, 10:13pm UTC](https://community.wowza.com/t/need-to-show-status-of-live-stream-on-website/250/2 "2013-10-07T22:13:50Z")

</div>

Hi Chris,

This example returns all published live stream names, and can be modified to check one stream

```auto
package test;
import java.util.Iterator;
import java.util.List;
import com.wowza.wms.amf.*;
import com.wowza.wms.client.*;
import com.wowza.wms.module.*;
import com.wowza.wms.request.*;
public class ModuleGetLiveStreams extends ModuleBase {
	public void getLiveStreams(IClient client, RequestFunction function,
			AMFDataList params) {
		
		AMFDataObj streams = new AMFDataObj();
		
		List<String> list = client.getAppInstance().getPublishStreamNames();
		
		Iterator<String> iter = list.iterator();
		int i=0;
		while (iter.hasNext())
		{
			streams.put("stream_" + i++,iter.next());
		}
		sendResult(client, params, streams); 
	}
}

```

AS3 client-side:

```auto
var clientObj:Object = new Object();
clientObj.getLiveStreams = function(streams:Object):void
{
for (var streamName:String in data)
	{
		trace("\t"+prop+":\t"+streams[streamName]);
	}
});
netconnection.client = clientObj;
netconnection.connect("rtmp://[wowza-address]:1935/[app-name]");

```

Richard

---

<div class="post-metadata">

**Author:** ![Thomas\_Gires](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@Thomas\_Gires](https://community.wowza.com/u/Thomas_Gires)\
**Post date:** [October 9, 2013, 1:07pm UTC](https://community.wowza.com/t/need-to-show-status-of-live-stream-on-website/250/3 "2013-10-09T13:07:13Z")

</div>

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:

```auto
		if (stristr(file_get_contents($streamurl), 'RESOLUTION')) {
			$status = 'active';
		} else {
			$status = 'inactive';
		}

```

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 🙂
