Reputation: 18545
Is there away to know how many person connects to a session? I wish to implement a mechanism where only two persons are allowed to connect, and if there is more than two, an alert will be shown.
Upvotes: 3
Views: 704
Reputation: 31
When you get a sessionConnected event, you get an array of connections telling you the number of people in the session. http://www.tokbox.com/opentok/docs/js/reference/SessionConnectEvent.html
After you are connected, everytime someone joins the session, you get ConnectionEvents for people leaving and joining the session.
These events can give you an accurate count of the # of connections in the session at any given time
Upvotes: 3