Answer for count viewers

Hello, Counting the output streams is a bit tricky because you must also count the clustered streams. So there is no out-of-the-box solution. You have 2 options here: 1. Use listStreams command. This will return the full list of streams. It will include both incoming and outgoing streams (publishers and subscribers). Having this list, you can cycle over it and only look at the input streams (elements having type property starting with "IN"). Each input stream has an array property called "outStreamsUniqueIds" which contains the unique stream ids for all subscribers. The count in this array represents exactly what you want 2. make use of web services and intercept outStreamCreated and streamClosed events. Having that, you can increment/decrement a counter I highly recommend solution #2 because is not poll based as #1. EMS is going to be relaxed and also your business rules on the web site are going to be greatly simplified. Also, by subscribing to those events, you get much more information about each and every subscriber (source ip/port, start/stop subscribing time, etc) Best regards, Andrei


Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.