Room
A room session.
Obtain one from VideoSDK.createRoom(...), then call join and use muteMic, unmuteMic, enableCam and the rest.
Every action needs a joined room. Actions here — and on Participant, RTCStream, PubSub and RealtimeStore — check the room state first; a rejected call sends nothing, changes nothing locally and returns without throwing, unless its own docs list the code under @throws. The reason reaches RoomEventListener.onError:
before join completes, or after the room ended —
3035(ERROR_ACTION_PERFORMED_BEFORE_ROOM_JOINED), with the rejected method named in the message;while the room is RoomState.RECONNECTING —
3065(ERROR_ROOM_RECONNECTING); rejected calls are not replayed once it reconnects;accepted while connected but overtaken by the room closing —
3056(ERROR_OPERATION_ABORTED).
Two exceptions: RealtimeStore.stopObserving detaches a listener locally, so it always runs and reports nothing; leave stays available while reconnecting and throws 3054 (ERROR_ALREADY_IN_REQUESTED_STATE) once the room has ended.
Every suspend member here is main-safe — call it from Dispatchers.Main and it will not block — and room events reach listeners on the main thread, though the onError raised by a rejected call or a capture fault arrives on the thread that raised it.
Properties
true when media is actually being encrypted, not merely when a key provider was set.
The last HLS state, as RoomEventListener.onHlsStateChanged reported it; HLSState.HLS_STOPPED before any was reported.
true while the local camera is publishing.
true while the local microphone is publishing.
true while the local participant's screen share is published.
The last livestream state, as RoomEventListener.onLivestreamStateChanged reported it; LiveStreamState.LIVESTREAM_STOPPED before any was reported.
The local participant. Available before join, but its id is only final once RoomEventListener.onRoomJoined has fired — until then it is the participantId you passed to createRoom, or empty.
The other participants, keyed by participant id. localParticipant is not in here.
Publish and subscribe to messages on this room's topics.
Shared key-value state for this room.
The last cloud-recording state, as RoomEventListener.onRecordingStateChanged reported it; RecordingState.RECORDING_STOPPED before any was reported.
The last transcription state, as RoomEventListener.onTranscriptionStateChanged reported it; TranscriptionState.TRANSCRIPTION_STOPPED before any was reported.
The last translation state, as RoomEventListener.onTranslationStateChanged reported it; TranslationState.TRANSLATION_STOPPED before any was reported.
Functions
Registers a listener for room events. Do it before join, or the join itself and the first participants can be missed.
Switches the webcam to the camera deviceId names: the camera is selected for this room, and a running webcam is disabled and re-enabled on it. A webcam that is off stays off — only the selection changes, and the next enableCam opens it.
Switches the webcam to customCameraTrack: a running camera is disabled and re-enabled with the track, so its encoder profile, facing and device id all take effect at once. A camera that is off is simply enabled with it, so the webcam is on either way.
Switches the call's audio route to the device deviceId names: it becomes the selected device, and a live mic is muted and unmuted on it. A muted mic stays muted; the next unmuteMic uses the new device.
Switches the microphone to customMicrophoneTrack: a live mic is muted and unmuted with the track, so its audio profile takes effect at once. A muted mic is simply unmuted with it, so the mic is on either way.
Changes the room mode of the local participant.
Changes the language this participant receives translations in. Only this device is affected; everyone else keeps the language they chose.
Turns adaptive subscription off: every stream goes back to the layer its publisher sends.
Stops sending video and closes the camera, so the OS camera indicator goes away rather than staying on with a black frame. Other participants see it through ParticipantEventListener.onStreamDisabled.
Stops sharing the screen and stops the foreground service that backed the share.
Turns on adaptive subscription: the server picks each incoming stream's quality from the viewport the app reported through Participant.setViewPort rather than whatever the publisher sends.
Enables the local participant's webcam and publishes it to the room.
Starts sharing the screen with a track from VideoSDK.createScreenShareVideoTrack, which carries the user's consent, the encoder profile, whether to publish simulcast layers and whether to capture system audio.
Starts sharing the screen from a MediaProjection consent the app already collected.
Fetches a previously uploaded base64 file and returns its content.
Returns the participant now sharing their screen, or null when nobody is. Follows RoomEventListener.onPresenterChanged.
Returns the participant now speaking, or null when the room is quiet. Follows RoomEventListener.onSpeakerChanged.
The camera capture config currently in force: {"width","height","frameRate","facingMode","codec","applied"}.
The video effects configuration currently in force.
Joins the room and starts publishing the microphone and camera requested in VideoSDK.createRoom.
Stops sending audio and releases the microphone, so the OS recording indicator goes away rather than staying on with a silent track. Other participants see it through ParticipantEventListener.onStreamDisabled.
Stops the server sending this participant remote media of one kind, which saves the bandwidth as well as the rendering — unlike simply hiding the tiles. Nobody else is affected.
Removes every registered RoomEventListener.
Removes a previously registered listener; an unknown listener is ignored.
Uninstalls the frame processor; frames go straight to the encoder again. Idempotent.
Asks another room to accept this one's media, so a broadcast can be forwarded into a second room without anyone rejoining.
Lets a waiting participant in, or turns them away.
Starts remote media of one kind flowing to this participant again after pauseAllStreams. RoomEventListener.onResumedAllStreams confirms it, once per kind.
Registers the listener told whenever a headset or Bluetooth device is plugged in or removed, or the selected route changes.
Changes the video effects configuration while the room is running.
Installs a processor that sees every captured camera frame before it is encoded — for an effect or overlay the SDK does not provide. Works before join too, so a pre-join preview is processed.
Caps the quality of the camera stream the local participant is sending.
Asks the server to publish the room as an HLS stream, for viewers who only watch — a webinar audience, say. They never join the room.
Asks the server to push the room to one or more RTMP destinations — YouTube Live, Twitch, your own ingest.
Asks the server to start recording the room to VideoSDK's cloud.
Starts live transcription for the whole room: everyone's speech, not just yours.
Starts live translation for the room.
Opens a shared whiteboard for the room. RoomEventListener.onWhiteboardStarted delivers the URL to load in a WebView.
Stops the HLS stream. RoomEventListener.onHlsStateChanged reports HLS_STOPPED once it has.
Stops the RTMP livestream. RoomEventListener.onLivestreamStopped confirms it.
Tears the whole relay to one room down, every kind at once. RoomEventListener.onMediaRelayStopped confirms it in this room; in the destination the relayed participants leave with REMOVE_PEER_MEDIA_RELAY_STOP.
Asks the server to stop recording. RoomEventListener.onRecordingStopped is the confirmation; the call returning is not.
Stops live transcription for the room. RoomEventListener.onTranscriptionStateChanged reports the service winding down.
Stops live translation for the room, for every participant, not just this one.
Closes the shared whiteboard for everyone. RoomEventListener.onWhiteboardStopped confirms it.
Unmutes the local microphone.
Uploads a base64-encoded file and returns its URL.