LeaveReason enum

Represents the reason why a participant left the meeting.

  • This enum is provided in the Events.roomLeft event callback when the local participant leaves the room. Each value contains a unique reason code and a descriptive message explaining why the participant was disconnected.

Possible Leave Reasons

  • websocketDisconnected (1001) Socket disconnected.

  • removePeer (1002) Participant was removed from the meeting.

  • removePeerViewerModeChanged (1003) Participant was removed because viewer mode was changed.

  • removePeerMediaRelayStop (1004) Participant was removed because media relay was stopped.

  • switchRoom (1005) Participant switched to a different room.

  • roomClose (1006) The meeting has been closed.

  • unknown (1007) Participant disconnected due to an unknown reason.

  • removeAll (1008) All participants were removed from the meeting.

  • meetingEndApi (1009) The meeting was ended using the Meeting End API.

  • removePeerApi (1010) Participant was removed using the Remove Participant API.

  • manualLeaveCalled (1101) Participant manually called the leave() method to exit the meeting.

  • websocketConnectionAttemptsExhausted (1102) Meeting left after multiple failed WebSocket connection attempts.

  • joinRoomFailed (1103) Meeting left due to an error while joining the room.

  • switchRoomFailed (1104) Meeting left due to an error while switching rooms.

Example

room.on(Events.roomLeft, (LeaveReason? reason) {
  if (reason != null) {
    print(
      'Left meeting due to ${reason.name} '
      '(code: ${reason.code}, message: ${reason.message})',
    );
  }
});
Inheritance
Available extensions

Values

websocketDisconnected → const LeaveReason
const LeaveReason(1001, "Socket disconnected")
removePeer → const LeaveReason
const LeaveReason(1002, "Participant was removed from the meeting")
removePeerViewerModeChanged → const LeaveReason
const LeaveReason(1003, "Participant Removed because viewer mode was changed")
removePeerMediaRelayStop → const LeaveReason
const LeaveReason(1004, "Participant Removed because media relay was stopped")
switchRoom → const LeaveReason
const LeaveReason(1005, "Participant switched to a different room")
roomClose → const LeaveReason
const LeaveReason(1006, "The meeting has been closed")
unknown → const LeaveReason
const LeaveReason(1007, "Participant disconnected due to an unknown reason")
removeAll → const LeaveReason
const LeaveReason(1008, "Remove All from the meeting")
meetingEndApi → const LeaveReason
const LeaveReason(1009, "Meeting Ended.")
removePeerApi → const LeaveReason
const LeaveReason(1010, "Participant removed from the meeting")
manualLeaveCalled → const LeaveReason
const LeaveReason(1101, "Participant manually called the leave() method to exit the meeting")
websocketConnectionAttemptsExhausted → const LeaveReason
const LeaveReason(1102, "Meeting left after multiple failed websocket connection attempts.")
joinRoomFailed → const LeaveReason
const LeaveReason(1103, "Meeting left due to an error while joining the room.")
switchRoomFailed → const LeaveReason
const LeaveReason(1104, "Meeting left due to an error while switching rooms.")

Properties

code int
Numeric reason code associated with the leave event.
final
hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
message String
Human-readable message describing the leave reason.
final
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<LeaveReason>
A constant List of the values in this enum, in order of their declaration.