Room Class Properties - iOS
All properties are read-only. The SDK updates them, and the matching events tell you when they change.
id
-
type:
String -
Unique id of the room where the participant has joined.
-
After a successful
switchTo(), it is the ID of the new room.
localParticipant
-
type: Participant
-
It will be the instance of Participant class for the local participant (you) who joined the room.
participants
-
type:
[Dictionary]of Participant -
[
String:Participant]- [
participantId,Participant]
- [
-
It will contain all joined participants in the room except the
localParticipant. -
This will be the
[Dictionary]that contains all participants, with the id of each participant as the key.
let remoteParticipantId = "ajf897"
let remoteParticipant = room?.participants[remoteParticipantId]
roomState
- type :
RoomState RoomStatewill be the current state of the room:CONNECTING,CONNECTED,RECONNECTING,DISCONNECTEDorFAILED. Changes are reported throughonRoomStateChanged.
roomMode
- type :
Mode? - The current mode of the local participant:
SEND_AND_RECV,RECV_ONLYorSIGNALLING_ONLY. It is set from themodeyou pass tocreateRoom()(SEND_AND_RECVwhen you pass none), and changes after a successfulchangeMode().
isMicEnabled
- type :
Bool truewhile your microphone is on. Before you join, it tells whether the microphone will be turned on at join.
isCamEnabled
- type :
Bool truewhile your camera is on. Before you join, it tells whether the camera will be turned on at join.
hlsUrls
- type :
HLSUrl?- playbackHlsUrl:
String? - livestreamUrl:
String?
- playbackHlsUrl:
hlsUrlswill provide all the URLs for the room's ongoing HLS stream. It isniluntil the HLS stream becomes playable.
hlsState
- type :
HLSState HLSStatewill be the current state of the room's HLS stream.
liveStreamState
- type :
LiveStreamState LiveStreamStatewill be the current state of the liveStream.
recordingState
- type :
RecordingState RecordingStatewill be the current state of the recording.
transcriptionState
-
type:
TranscriptionState -
It gives the current state of transcription in the room, initially it is
TRANSCRIPTION_STOPPED.
translationState
-
type:
TranslationState -
It gives the current state of realtime translation in the room, initially it is
TRANSLATION_STOPPED. Changes are reported throughonTranslationStateChanged.
pinnedParticipants
-
type:
[String: ParticipantPinState] -
The participants who are pinned, keyed by participant ID. A participant is removed from the dictionary once nothing of theirs is pinned.
-
ParticipantPinStatehas two properties,cam: Boolandshare: Bool, which tell you whether the camera and the screen share are pinned.
for (participantId, pinState) in room?.pinnedParticipants ?? [:] {
print("\(participantId) cam: \(pinState.cam), share: \(pinState.share)")
}
isScreenSharing
-
type:
Bool -
truewhile the local participant's screen share is active, from the momentenableScreenShare()shows the broadcast picker until the share ends. The share ends when you calldisableScreenShare(), when the user stops it from Control Center, or when iOS ends the broadcast.
Task {
do {
if room?.isScreenSharing == true {
try await room?.disableScreenShare()
} else {
try await room?.enableScreenShare()
}
} catch {
print("Screen share failed: \(error)")
}
}
e2eeEnabled
-
type:
Bool -
truewhen you joined with a key provider set throughVideoSDK.setKeyProvider(_:)that holds a shared key or participant keys. It is set when you join.
pubSub
-
type:
PubSub -
It is used to send and receive messages on topics. See PubSub.
realtimeStore
-
type:
RealtimeStore -
It is used to store values that all participants can read and observe. See Realtime Store.
LeaveReason Enum
The LeaveReason enum provides detailed context for why a room or participant departure event was triggered. Each case also has a message property with a readable description. The following table lists all possible values and their message:
| Code | Reason | message |
|---|---|---|
| 1001 | WEBSOCKET_DISCONNECTED | Socket disconnected |
| 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 |
| 1007 | UNKNOWN | Participant disconnected due to an unknown reason |
| 1008 | REMOVE_ALL | All participants were removed from the room |
| 1009 | MEETING_END_API | Room ended |
| 1010 | REMOVE_PEER_API | Participant was removed from the room |
| 1011 | DUPLICATE_PARTICIPANT | Participant left because the same user joined from another device |
| 1101 | MANUAL_LEAVE_CALLED | Participant manually left the room |
| 1102 | WEBSOCKET_CONNECTION_ATTEMPTS_EXHAUSTED | Room left after multiple failed websocket connection attempts |
| 1103 | JOIN_ROOM_FAILED | Failed to join the room |
| 1104 | SWITCH_ROOM_FAILED | Failed to switch rooms |
Got a Question? Ask us on discord

