Skip to main content
Version: 3.x.x

Room Class Properties - Android

id​

  • type: String

  • id is the unique ID of the room the participant joins. It is the roomId you passed to VideoSDK.createRoom(), then the target of the last successful switchTo().


localParticipant​

  • type: Participant

  • The Participant object for you, the local participant.

  • It is available before join(), but its id is final only once onRoomJoined fires. Until then it is the participantId you passed to createRoom(), or empty.


participants​

  • type: Map<String, Participant>

  • 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

  • roomState is the current connection state of the room: CONNECTING, CONNECTED, RECONNECTING, DISCONNECTED or FAILED. It is DISCONNECTED before join() is called.

  • It can read CONNECTED while a waiting-room entry request is still pending. Wait for onRoomJoined before you call other room methods.

  • onRoomStateChanged reports the changes. It sends CONNECTED together with onRoomJoined, 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

  • true while the local microphone is publishing.


isCamEnabled​

  • type: Boolean

  • true while the local camera is publishing.


isScreenSharing​

  • type: Boolean

  • true while the local participant's screen share is published.


e2eeEnabled​

  • type: Boolean

  • true only 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 onRecordingStateChanged reported it: RECORDING_STARTING, RECORDING_STARTED, RECORDING_STOPPING or RECORDING_STOPPED.

  • It is RECORDING_STOPPED before any state was reported. It goes back to RECORDING_STOPPED when the room is left and on switchTo().

Example​

if (room.recordingState == RecordingState.RECORDING_STARTED) {
Log.d("VideoSDK", "The room is being recorded")
}

hlsState​

  • type: HLSState

  • The last HLS state, as onHlsStateChanged reported it: HLS_STARTING, HLS_STARTED, HLS_PLAYABLE, HLS_STOPPING or HLS_STOPPED.

  • It is HLS_STOPPED before any state was reported. It goes back to HLS_STOPPED when the room is left and on switchTo().

Example​

if (room.hlsState == HLSState.HLS_PLAYABLE) {
Log.d("VideoSDK", "HLS can be played now")
}

liveStreamState​

  • type: LiveStreamState

  • The last livestream state, as onLivestreamStateChanged reported it: LIVESTREAM_STARTING, LIVESTREAM_STARTED, LIVESTREAM_STOPPING or LIVESTREAM_STOPPED.

  • It is LIVESTREAM_STOPPED before any state was reported. It goes back to LIVESTREAM_STOPPED when the room is left and on switchTo().


transcriptionState​

  • type: TranscriptionState

  • The last real-time transcription state, as onTranscriptionStateChanged reported it: TRANSCRIPTION_STARTING, TRANSCRIPTION_STARTED, TRANSCRIPTION_STOPPING or TRANSCRIPTION_STOPPED.

  • It is TRANSCRIPTION_STOPPED before any state was reported. It goes back to TRANSCRIPTION_STOPPED when the room is left and on switchTo().


translationState​

  • type: TranslationState

  • The last real-time translation state, as onTranslationStateChanged reported it: TRANSLATION_STARTING, TRANSLATION_STARTED, TRANSLATION_STOPPING or TRANSLATION_STOPPED.

  • It is TRANSLATION_STOPPED before any state was reported. It goes back to TRANSLATION_STOPPED when the room is left and on switchTo().


pubSub​

  • type: PubSub
  • Publish messages to a topic and subscribe to the topics you want to receive. See PubSub.

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:

CodeReason ConstantDescription
1001WEBSOCKET_DISCONNECTEDThe connection dropped and the session could not be resumed.
1002REMOVE_PEERParticipant was removed from the room.
1003REMOVE_PEER_VIEWER_MODE_CHANGEDParticipant removed because viewer mode was changed.
1004REMOVE_PEER_MEDIA_RELAY_STOPParticipant removed because media relay was stopped.
1005SWITCH_ROOMParticipant switched to a different room.
1006ROOM_CLOSEThe room has been closed. The other participants get this after someone calls end().
1007UNKNOWNParticipant disconnected due to an unknown reason.
1008REMOVE_ALLEveryone was removed from the room.
1009MEETING_END_APIThe room was ended with end() or the REST API.
1010REMOVE_PEER_APIParticipant was removed from the room with the REST API.
1011DUPLICATE_PARTICIPANTLeaving the room, since this participantId joined from another device.
1101MANUAL_LEAVE_CALLEDParticipant called the leave() method to exit the room.
1102WEBSOCKET_CONNECTION_ATTEMPTS_EXHAUSTEDThe connection could not be restored: the network stayed down for 2 minutes, or every reconnect attempt failed. Create a new room to join again.
1103JOIN_ROOM_FAILEDRoom left due to an error while joining the room.
1104SWITCH_ROOM_FAILEDRoom left due to an error while switching rooms.

Got a Question? Ask us on discord