Preview connections in session

When having a Google Meet video call you get to see a list of people already connected to the call.

I’d like to implement this feature using OpenVidu and wonder if there is a recommended way of doing this.

I am guessing that we can accomplish this by polling the OpenVidu REST API, /openvidu/api/sessions/<SESSION_ID>, every x seconds. It would give us a list of connections objects.

Is there any way to accomplish this via the openvidu-browser API, by subscribing and not polling?

Hi, this feature is already included on our official OpenVidu Call (which uses OpenVidu Components). Check it out here

Any user connected to a Session always has this information available. You don’t actually need to call the REST API and send the information to your client-side to achieve this.
Just listen to connectionCreated events on your frontend. connectionCreated event is fired for any user connecting to the Session. connectionDestroyed event is fired for any user leaving the Session. With these two events, you will always have available the participants connected to a Session in all clients: ConnectionEvent | OpenVidu Browser - v2.22.0

Thank you @CSantosM & @pabloFuente

1 Like