Skip to main content
Version: 4.x.x

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
  • RoomState will be the current state of the room: CONNECTING, CONNECTED, RECONNECTING, DISCONNECTED or FAILED. Changes are reported through onRoomStateChanged.

roomMode​

  • type : Mode?
  • The current mode of the local participant: SEND_AND_RECV, RECV_ONLY or SIGNALLING_ONLY. It is set from the mode you pass to createRoom() (SEND_AND_RECV when you pass none), and changes after a successful changeMode().

isMicEnabled​

  • type : Bool
  • true while your microphone is on. Before you join, it tells whether the microphone will be turned on at join.

isCamEnabled​

  • type : Bool
  • true while 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?
  • hlsUrls will provide all the URLs for the room's ongoing HLS stream. It is nil until the HLS stream becomes playable.

hlsState​

  • type : HLSState
  • HLSState will be the current state of the room's HLS stream.

liveStreamState​

  • type : LiveStreamState
  • LiveStreamState will be the current state of the liveStream.

recordingState​

  • type : RecordingState
  • RecordingState will 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 through onTranslationStateChanged.


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.

  • ParticipantPinState has two properties, cam: Bool and share: 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

  • true while the local participant's screen share is active, from the moment enableScreenShare() shows the broadcast picker until the share ends. The share ends when you call disableScreenShare(), 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

  • true when you joined with a key provider set through VideoSDK.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:

CodeReasonmessage
1001WEBSOCKET_DISCONNECTEDSocket disconnected
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
1007UNKNOWNParticipant disconnected due to an unknown reason
1008REMOVE_ALLAll participants were removed from the room
1009MEETING_END_APIRoom ended
1010REMOVE_PEER_APIParticipant was removed from the room
1011DUPLICATE_PARTICIPANTParticipant left because the same user joined from another device
1101MANUAL_LEAVE_CALLEDParticipant manually left the room
1102WEBSOCKET_CONNECTION_ATTEMPTS_EXHAUSTEDRoom left after multiple failed websocket connection attempts
1103JOIN_ROOM_FAILEDFailed to join the room
1104SWITCH_ROOM_FAILEDFailed to switch rooms

Got a Question? Ask us on discord