Skip to main content
Version: 0.0.x

Meeting Connection Events - Javascript

VideoSDK offers the meeting-state-changed event, providing information about the current connection state of the meeting.

meeting-state-changed

  • This event is triggered when the state of a meeting changes.
  • The event callback will include the current state of the meeting, which can be one of the following: CONNECTING, CONNECTED, FAILED, DISCONNECTED, CLOSING, CLOSED.
  • It can be subscribed to using the meeting object.

Example

Here is an example demonstrating the usage of the event mentioned on this page.

let meeting;

// Initialize Meeting
meeting = VideoSDK.initMeeting({
// ...
});

meeting.on("meeting-state-changed", (data) => {
const { state } = data;

swtich(state){
case 'CONNECTING':
console.log("Meeting is Connecting" );
break;
case 'CONNECTED':
console.log("Meeting is Connected" );
break;
case 'FAILED':
console.log("Meeting connection failed" );
break;
case 'DISCONNECTED':
console.log("Meeting connection disconnected abruptly" );
break;
case 'CLOSING':
console.log("Meeting is closing" );
break;
case 'CLOSED':
console.log("Meeting connection closed" );
break;
}
//
});

API Reference

The API references for all the methods and events utilized in this guide are provided below.

Got a Question? Ask us on discord