Room Class Properties - Android
id
-
type:
String -
idis the unique ID of the room the participant joins. It is theroomIdyou passed toVideoSDK.createRoom(), then the target of the last successfulswitchTo().
localParticipant
-
type: Participant
-
The Participant object for you, the local participant.
-
It is available before
join(), but itsidis final only onceonRoomJoinedfires. Until then it is theparticipantIdyou passed tocreateRoom(), or empty.
participants
-
type:
Map<String, Participant>- Map<
participantId, Participant>
- Map<
-
It contains all joined participants in the room except the
localParticipant, with the ID of each participant as the key. -
It is a live view, not a copy: it changes as participants join and leave. Copy it before you iterate it anywhere but the main thread.
Example
val remoteParticipantId = "ajf897"
val participant: Participant? = room.participants[remoteParticipantId]
// a copy you can iterate on any thread
val remoteParticipants: List<Participant> = room.participants.values.toList()
roomState
-
type:
RoomState -
roomStateis the current connection state of the room:CONNECTING,CONNECTED,RECONNECTING,DISCONNECTEDorFAILED. It isDISCONNECTEDbeforejoin()is called. -
It can read
CONNECTEDwhile a waiting-room entry request is still pending. Wait foronRoomJoinedbefore you call other room methods. -
onRoomStateChangedreports the changes. It sendsCONNECTEDtogether withonRoomJoined, and again when a connection problem is fixed without rejoining.
Example
val state: RoomState = room.roomState
if (state == RoomState.RECONNECTING) {
Log.d("VideoSDK", "The room is reconnecting")
}
isMicEnabled
-
type:
Boolean -
truewhile the local microphone is publishing.
isCamEnabled
-
type:
Boolean -
truewhile the local camera is publishing.
isScreenSharing
-
type:
Boolean -
truewhile the local participant's screen share is published.
e2eeEnabled
-
type:
Boolean -
trueonly while media is actually being encrypted, not merely when a key provider has been set. Learn more about end-to-end encryption.
recordingState
-
type:
RecordingState -
The last cloud-recording state, as
onRecordingStateChangedreported it:RECORDING_STARTING,RECORDING_STARTED,RECORDING_STOPPINGorRECORDING_STOPPED. -
It is
RECORDING_STOPPEDbefore any state was reported. It goes back toRECORDING_STOPPEDwhen the room is left and onswitchTo().
Example
if (room.recordingState == RecordingState.RECORDING_STARTED) {
Log.d("VideoSDK", "The room is being recorded")
}
hlsState
-
type:
HLSState -
The last HLS state, as
onHlsStateChangedreported it:HLS_STARTING,HLS_STARTED,HLS_PLAYABLE,HLS_STOPPINGorHLS_STOPPED. -
It is
HLS_STOPPEDbefore any state was reported. It goes back toHLS_STOPPEDwhen the room is left and onswitchTo().
Example
if (room.hlsState == HLSState.HLS_PLAYABLE) {
Log.d("VideoSDK", "HLS can be played now")
}
liveStreamState
-
type:
LiveStreamState -
The last livestream state, as
onLivestreamStateChangedreported it:LIVESTREAM_STARTING,LIVESTREAM_STARTED,LIVESTREAM_STOPPINGorLIVESTREAM_STOPPED. -
It is
LIVESTREAM_STOPPEDbefore any state was reported. It goes back toLIVESTREAM_STOPPEDwhen the room is left and onswitchTo().
transcriptionState
-
type:
TranscriptionState -
The last real-time transcription state, as
onTranscriptionStateChangedreported it:TRANSCRIPTION_STARTING,TRANSCRIPTION_STARTED,TRANSCRIPTION_STOPPINGorTRANSCRIPTION_STOPPED. -
It is
TRANSCRIPTION_STOPPEDbefore any state was reported. It goes back toTRANSCRIPTION_STOPPEDwhen the room is left and onswitchTo().
translationState
-
type:
TranslationState -
The last real-time translation state, as
onTranslationStateChangedreported it:TRANSLATION_STARTING,TRANSLATION_STARTED,TRANSLATION_STOPPINGorTRANSLATION_STOPPED. -
It is
TRANSLATION_STOPPEDbefore any state was reported. It goes back toTRANSLATION_STOPPEDwhen the room is left and onswitchTo().
pubSub
- type:
PubSub - Publish messages to a topic and subscribe to the topics you want to receive. See
PubSub.
realtimeStore
- type:
RealtimeStore - Key-value data shared with everyone in the room. See
RealtimeStore.
LeaveReason Enum
LeaveReason says why you left the room (onRoomLeft) or why another participant left (onParticipantLeft). Each value has a code and a message. When the server sends no reason, onRoomLeft reports MANUAL_LEAVE_CALLED and onParticipantLeft reports UNKNOWN. The following table lists all possible values:
| Code | Reason Constant | Description |
|---|---|---|
| 1001 | WEBSOCKET_DISCONNECTED | The connection dropped and the session could not be resumed. |
| 1002 | REMOVE_PEER | Participant was removed from the room. |
| 1003 | REMOVE_PEER_VIEWER_MODE_CHANGED | Participant removed because viewer mode was changed. |
| 1004 | REMOVE_PEER_MEDIA_RELAY_STOP | Participant removed because media relay was stopped. |
| 1005 | SWITCH_ROOM | Participant switched to a different room. |
| 1006 | ROOM_CLOSE | The room has been closed. The other participants get this after someone calls end(). |
| 1007 | UNKNOWN | Participant disconnected due to an unknown reason. |
| 1008 | REMOVE_ALL | Everyone was removed from the room. |
| 1009 | MEETING_END_API | The room was ended with end() or the REST API. |
| 1010 | REMOVE_PEER_API | Participant was removed from the room with the REST API. |
| 1011 | DUPLICATE_PARTICIPANT | Leaving the room, since this participantId joined from another device. |
| 1101 | MANUAL_LEAVE_CALLED | Participant called the leave() method to exit the room. |
| 1102 | WEBSOCKET_CONNECTION_ATTEMPTS_EXHAUSTED | The connection could not be restored: the network stayed down for 2 minutes, or every reconnect attempt failed. Create a new room to join again. |
| 1103 | JOIN_ROOM_FAILED | Room left due to an error while joining the room. |
| 1104 | SWITCH_ROOM_FAILED | Room left due to an error while switching rooms. |
Got a Question? Ask us on discord

