Skip to main content
Version: Next

Meeting Connection Events - React Native

VideoSDK provides onMeetingStateChanged event which will notify you of the current connection state of the meeting.

onMeetingStateChanged

  • This event will be triggered when state of meeting changes.
  • It will pass state as an event callback parameter which will indicate current state of the meeting.
  • All available states are CONNECTING, CONNECTED, FAILED, DISCONNECTED, CLOSING, CLOSED.
  • This event can be subscribed from the useMeeting hook.

Example

Here is the usage of the event mentioned in this page.

function onMeetingStateChanged(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;
}
}

const {
meetingId
...
} = useMeeting({
onMeetingStateChanged,
...
});

API Reference

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

Got a Question? Ask us on discord