Flussonic

Viewer Count from Event API

I see there is a API call that you can use to fetch stream information including the “client_count” but is there a reliable way to pull this information through the Events API? I tried using the play_connected, push_connected, play_closed, and push_closed events but they weren’t coming in reliably enough to keep a viewer count.

Good question.

  1. you should get play_started and play_closed as brackets. They are emitted in pairs and we check it very strictly
  2. it is not a best approach to rely on this mechanism. Well, it is possible and we will send these events, but you need to spend a lot of time on the reliability of event capturing and be ready for huge load spikes.

What exactly do you want to achieve?

I’m mainly looking for a reliable way to make sure the client count on my front end matches what flussonic says.

I went the route of using the HTTP API and that works out pretty well.
https://flussonic.com/doc/api/reference/#tag/stream/operation/streams_list

I pull all of the streams and use the client_count field inside of stats.