create Room
Creates a Room for roomId without connecting to it.
Nothing reaches the network here: register your listeners on the returned room, then call Room.join to connect.
Every argument is fixed at join time. To change the microphone, camera, mode or translation language later, use the Room methods rather than calling createRoom again.
Code Example:
val room = VideoSDK.createRoom(
roomId = "abcd-efgh-ijkl",
token = "YOUR_AUTH_TOKEN",
participantName = "Ada Lovelace",
micEnabled = true,
camEnabled = true,
)
room.addEventListener(roomEventListener)
lifecycleScope.launch { room.join() }Return
Parameters
unique ID of the room to join. Create one with the Create Room API. If empty, throws code 3073 (ERROR_INVALID_PARAMETER).
the JWT authentication token, generated on your server with your VideoSDK API key and secret. If empty, throws code 3073 (ERROR_INVALID_PARAMETER); a malformed or expired one is refused by the server, so it surfaces as a failed Room.join.
display name shown to other participants. If null or empty, a random 6-character name is used.
if true, the microphone is published on join. RECORD_AUDIO must already be granted, or the microphone does not start.
if true, the camera is published on join. CAMERA must already be granted, or the camera does not start and the failure is reported on RoomEventListener.onError.
unique participant identifier. If null or empty, a random 8-character one is generated.
the room mode. If null, defaults to Mode.SEND_AND_RECV.
if true, the camera is published as a simulcast ladder instead of a single stream. If null, defaults to true.
the camera track to publish instead of the default camera, from createCameraVideoTrack. If null, the default camera is used.
the microphone track to publish instead of the default microphone, from createMicrophoneAudioTrack. If null, the default microphone is used.
JSON metadata attached to this participant. If null, none is attached.
custom signaling server base URL. If null, the VideoSDK signaling server is used.
preferred network protocol for media. If null, defaults to PreferredProtocol.UDP_OVER_TCP.
if true, the video codec you send switches to VP8 when a remote participant cannot decode it, and RoomEventListener.onCodecChanged fires. Unrelated to the hardware-encoder fallback, which always runs.
if true, server notifications are received in batches.
language incoming speech is translated into. If null, translation is off.
language this participant speaks.
the size the default camera opens at. With MaxResolution.sd it opens at 960x540 (or the largest 16:9 size below it the camera offers) instead of 1280x720. A customCameraTrack keeps its own encoderConfig. If null, defaults to MaxResolution.hd.
the camera the default camera track opens on. A customCameraTrack keeps its own facingMode, and after Room.changeCam the camera stays on the one switched to. Defaults to FacingMode.front.
if true, every remote participant's microphone and camera are received as soon as they publish. If false, nothing is received until you call Participant.consumeMicStreams / Participant.consumeWebcamStreams for that participant, which saves bandwidth in large rooms: call them from RoomEventListener.onParticipantJoined and ParticipantEventListener.onMediaStatusChanged. Until then no onStreamEnabled fires for that media. Screen shares have no consume call. Defaults to true.
if true, the server lowers the quality of the camera stream the local participant sends while no remote participant is watching its larger layers, and raises it again when one is, which saves upload bandwidth. Never goes above the cap set with Room.setWebcamQuality. Has no effect on a camera sending a single layer (multiStream off, or a non-VP8 VideoCodec). Defaults to false.
Throws
if initialize has not been called.