LeaveReason enum
Why a participant left the room.
Delivered with Events.roomLeft when the local participant leaves, and with Events.participantLeft when someone else does. Each value carries a numeric code and a short message for logs.
Example
room.on(Events.roomLeft, (LeaveReason? reason) {
if (reason != null) {
print(
'Left room due to ${reason.name} '
'(code: ${reason.code}, message: ${reason.message})',
);
}
});
Values
- WEBSOCKET_DISCONNECTED → const LeaveReason
-
The connection to the server dropped.
const LeaveReason(1001, "Socket disconnected") - REMOVE_PEER → const LeaveReason
-
Removed from the room by another participant.
const LeaveReason(1002, "Participant was removed from the room") - REMOVE_PEER_VIEWER_MODE_CHANGED → const LeaveReason
-
Removed because their viewer mode changed.
const LeaveReason(1003, "Participant Removed because viewer mode was changed") - REMOVE_PEER_MEDIA_RELAY_STOP → const LeaveReason
-
Removed because a media relay stopped.
const LeaveReason(1004, "Participant Removed because media relay was stopped") - SWITCH_ROOM → const LeaveReason
-
Moved to a different room with Room.switchTo.
const LeaveReason(1005, "Participant switched to a different room") - ROOM_CLOSE → const LeaveReason
-
The room was closed.
const LeaveReason(1006, "The room has been closed") - UNKNOWN → const LeaveReason
-
Disconnected for a reason the server did not report.
const LeaveReason(1007, "Participant disconnected due to an unknown reason") - REMOVE_ALL → const LeaveReason
-
Everyone was removed from the room.
const LeaveReason(1008, "Remove All from the room") - MEETING_END_API → const LeaveReason
-
The room was ended with the Meeting End API.
const LeaveReason(1009, "Room Ended.") - REMOVE_PEER_API → const LeaveReason
-
Removed with the Remove Participant API.
const LeaveReason(1010, "Participant removed from the room") - DUPLICATE_PARTICIPANT → const LeaveReason
-
The same participant id joined from another device.
const LeaveReason(1011, "Leaving room, since this participantId joined from another device") - MANUAL_LEAVE_CALLED → const LeaveReason
-
Left by calling Room.leave.
const LeaveReason(1101, "Participant manually called the leave() method to exit the room") - WEBSOCKET_CONNECTION_ATTEMPTS_EXHAUSTED → const LeaveReason
-
Left after repeated attempts to reconnect to the server failed.
const LeaveReason(1102, "Room left after multiple failed websocket connection attempts.") - JOIN_ROOM_FAILED → const LeaveReason
-
Left because joining the room failed.
const LeaveReason(1103, "Room left due to an error while joining the room.") - SWITCH_ROOM_FAILED → const LeaveReason
-
Left because moving to another room failed.
const LeaveReason(1104, "Room 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.