Objective
Ending a session for all participants.
Applies To
- Video API
Procedure
An Opentok session cannot be destroyed, but it is possible to disconnect clients from it and prevent them from rejoining.
A Publisher with a token that has a “Moderator” role assigned can force any user to disconnect from a session.
To do so, the Moderator calls the forceDisconnect() method of the Session object, passing in the Connection object for the client you want to disconnect:
session.forceDisconnect(connection);
In order to prevent rejoining a session, you can generate a token that has a short lifespan. Once the client that got disconnected from a session (and has an expired token) cannot rejoin the session.
Additional Information
Note, that even when a token is expired, a client will stay connected to a session until gets disconnected (either by calling forceDisconnect() or on its own).
Articles in this section
- Why isn't the Video Inspector displaying user information and events?
- Has the Video Session Monitoring Callback data changed?
- Vonage Scalable Video Simulcast
- How can I find the creation or expiration time of a token?
- What does OT.checkSystemRequirements() check?
- How to Get HD/FHD Resolution Recordings and Live Streaming in Vonage Video API Sessions
- How can I implement a ringing or calling application with Vonage Video API?
- How can I get information about multiple sessionIds in one Insights GraphQL query?
- What codecs are supported on the Vonage Video API platform?
- Can I set the Audio Output device when using the Vonage Video API in Javascript