Hi, I try to find out in REST API how to identify current connections to every stream, which are indicated in smil file. I use several streams in smil files for different quality. And point player to smil file via http hls protocol.
I can find information about application and all connections in application. But there are no current connections for every instance (stream) in application
/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}/instances/{instanceName}/incomingstreams/{streamName}/monitoring/current
But when we specify smil file like instance in this request we get only all connections for this smil file.
Tell me the direction How to find out how many viewers on each stream from smil file?
thank you
I’d like to know this too!
Hello @Blair Liikala I just saw this was never answered- so sorry about that.
For HTTP sessions, you can implement the IVHostHTTPStreamerRequestValidator interface in order to check all incoming HTTP sessions. You can then have code that tracks the sessions, increments them, and checks when it changes the bitrate requested in the chunk request ID. You can identify each session through the session ID.
For example:
public class HTTPRequestHandler implements IVHostHTTPStreamerRequestValidator{public boolean validateHTTPStreamerRequest(RtmpRequestMessage arg0,HostPort arg1, String arg2) { // check request pathreturn true;}
Create the class that sets the validator via the IVHostNotify interface:
public class VHostListener implements IVHostNotify{
public void onVHostCreate(IVHost vhost)
{vhost.setHTTPStreamerRequestValidator(new HTTPRequestHandler());
}
}
Add it as a vhost listener within your conf/Server.xml file as follows:
<VHostListeners>
<VHostListener>
<BaseClass>path.to.your.VHostListener</BaseClass>
</VHostListener></VHostListeners>