Skip to main content

Room Connection Events

The meeting object emits various events to indicate changes in the connection status of the room. When a connection is lost, the Dyte SDK detects it and attempts to reconnect the user to the meeting room automatically.

You can subscribe to these events by implementing the DyteMeetingRoomEventsListener callbacks and passing the object to the meeting.addMeetingRoomEventsListener(dyteMeetingRoomEventsListener).

The following are the room connection events:

Connecting to room

When the local user starts connecting to the meeting room during initialization, this event is triggered.

meeting.addMeetingRoomEventsListener(object : DyteMeetingRoomEventsListener {
override fun onConnectingToMeetingRoom() {
// connecting to meeting room
}
});

Connected to room

When the local user connects to the meeting room after initialization, this event is triggered.

meeting.addMeetingRoomEventsListener(object : DyteMeetingRoomEventsListener {
override fun onConnectedToMeetingRoom() {
// triggered once connected to meeting room
}
});

Room connection failed

When the local user fails to connect to the meeting room during initialization, this event is triggered. This might occur because of internet connection issues.

meeting.addMeetingRoomEventsListener(object : DyteMeetingRoomEventsListener {
override fun onMeetingRoomConnectionFailed() {
// triggered once connection to the room is failed
}
});

Disconnected from room

When the local user disconnects while leaving the meeting room, this event is triggered.

meeting.addMeetingRoomEventsListener(object : DyteMeetingRoomEventsListener {
override fun onDisconnectedFromMeetingRoom() {
// triggered once disconnected from meeting room
}
});

Reconnecting to room

When the Dyte SDK detects a connection drop and attempts to reconnect to the meeting room, this event is triggered.

meeting.addMeetingRoomEventsListener(object : DyteMeetingRoomEventsListener {
override fun onReconnectingToMeetingRoom() {
// triggered when reconnection is starting to the room
}
});

Reconnected to room

When the local user successfully reconnects to the meeting room, this event is triggered.

meeting.addMeetingRoomEventsListener(object : DyteMeetingRoomEventsListener {
override fun onReconnectedToMeetingRoom() {
// triggered once reconnection to the room is complete
}
});

Room reconnection failed

When the local user fails to reconnect to the meeting room, this event is triggered. This occurs when the local user's internet connection goes down for an extended period of time and the Dyte SDK is unable to reconnect despite multiple attempts.

meeting.addMeetingRoomEventsListener(object : DyteMeetingRoomEventsListener {
override fun onMeetingRoomReconnectionFailed() {
// triggered once re-connection to the room is failed
}
});