# How to get HLS live stream information

**URL:** <https://community.wowza.com/t/how-to-get-hls-live-stream-information/45086>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [May 21, 2015, 5:39pm UTC](https://community.wowza.com/t/how-to-get-hls-live-stream-information/45086 "2015-05-21T17:39:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohit\_Shakya](https://avatars.discourse-cdn.com/v4/letter/m/e5b9ba/32.png) [@Mohit\_Shakya](https://community.wowza.com/u/Mohit_Shakya)\
**Post date:** [May 21, 2015, 5:39pm UTC](https://community.wowza.com/t/how-to-get-hls-live-stream-information/45086/1 "2015-05-21T17:39:30Z")

</div>

Hi,

I am working on wowza live streaming analytics module for hls and rtmp streams.

i want to fetch following information from HLS and RTMP type live streaming…

-\> viewer’s information

-\> viewer-end user-agent

-\> total data streamed to viewer

-\> total play duration of media

-\> flavours played during the stream.

i’ve fetched this data for RTMP live striming using following listener and classes:

-\>Listener: IMediaStream.addClientListener()

-\>Notifier: IMediaStreamActionNotify3

-\>Some wowza’s basic server API

i am not aware about the listener to get stream specific information in case of HLS(cupertino) live streaming.

i’ve achieved following in case of HLS(cupertino) live streaming:

-\> total data transferred to viewer

-\> user-agent

-\> viewer’s information

and the information that is not achieved yet in HLS live streaming:

-\>total play duration of media

-\>flavors played during the stream

i’ve tried HTTPStreamerApplicationContextCupertinoStreamer.addVODActionListener() but is works with VOD type application only.

Can you please help me on this?

Thanks.

---

<div class="post-metadata">

**Author:** ![Matt\_Young](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/matt_young/32/389_2.png) [@Matt\_Young](https://community.wowza.com/u/Matt_Young)\
**Post date:** [May 19, 2016, 3:08am UTC](https://community.wowza.com/t/how-to-get-hls-live-stream-information/45086/2 "2016-05-19T03:08:51Z")

</div>

Hello

For the two elements you are having trouble obtaining for live streams, you can check out the following:

**- Total Play Duration of the media**

if you are looking on a per client basis, you can simply use time running from the session object as follows:

```auto
httpSession.getTimeRunningSeconds()

```

**- Flavors played during the stream**

You can depict which protocol by doing something like the following:

```auto
public void onHTTPSessionCreate(IHTTPStreamerSession httpSession){
  switch(httpSession.getSessionProtocol()){
	case IHTTPStreamerSession.SESSIONPROTOCOL_CUPERTINOSTREAMING:
		getLogger().info("Cupertino..");
	break;
	case IHTTPStreamerSession.SESSIONPROTOCOL_MPEGDASHSTREAMING:
		getLogger().info("Dash..");
	break;
	// ...
  }
}

```

Thanks,

Matt
