Video SDK
Entry point for the SDK: process-wide setup, device lists and the track factories.
Call initialize, then createRoom with your auth token to build a Room, then Room.join to connect. Neither setup call suspends — only Room.join and the room actions do.
VideoSDK.initialize(applicationContext)
val room = VideoSDK.createRoom(
roomId = roomId,
token = authToken,
participantName = "Ada",
)
room.addEventListener(object : RoomEventListener() {
override fun onRoomJoined(switchRoomId: String?) {
// you are in the room
}
})
lifecycleScope.launch { room.join() }The SDK runs one room per process: leave the current room before joining another.
Types
Transport the media connection prefers. Pass one to createRoom.
Functions
Requests the runtime permissions a call needs, prompting the user when any are missing and reporting the outcome on permissionHandler. When all of them are already held it reports success without showing anything.
Creates a camera track and opens the camera for a self-view: pass CustomStreamTrack.track to VideoView.addTrack to preview before join, and the track to createRoom / Room.enableCam(track) to publish that camera without reopening it.
Creates a microphone track and opens the input. Pass it to createRoom as customMicrophoneTrack or to Room.unmuteMic(track); nothing is sent until it is published, and CustomStreamTrack.stop closes the microphone. There is no level API.
Creates a screen-share video track from the user's MediaProjection consent.
Stops sending telemetry to VideoSDK's backend: the pending batch is flushed, then the pipeline shuts down for the rest of the process. Read the flag back with isTelemetryEnabled.
Marks backend telemetry as enabled, which it already is when the SDK starts.
Returns the route the OS is really playing through, which can differ from getSelectedAudioDevice while a route change is still settling. null before initialize.
The video effects configuration currently in force.
Returns the cameras Camera2 reports. Empty until initialize has run.
Returns every camera, then every audio route: CameraDeviceInfo and MicrophoneDeviceInfo entries, the same ones getCameras and getMics list. Empty until initialize has run.
Returns a JSONObject mapping every catalogue name (e.g. "INVALID_API_KEY") to its numeric code (e.g. 4001):
Returns the configured BaseKeyProvider, or null if not set.
Returns the log level set with setLogLevel; LogLevel.INFO until it is called.
Returns the audio routes currently attached — speaker, earpiece, wired headset, Bluetooth. Empty until initialize has run.
Returns the audio route the SDK is set to use. Picks a sensible default on the first read, so it is null only before initialize or when the device reports no route at all. Room.setAudioDevice changes it.
Returns the camera the SDK last opened or was last pointed at, or null before any camera has been used.
Starts the SDK for this process: begins audio routing, enumerates devices and hooks the activity lifecycle that pauses the webcam in the background.
Returns whether backend telemetry is currently enabled.
Publishes the subject that auto-framing follows, as a box normalised to 0.0..1.0.
Turns end-to-end encryption off and forgets the provider set with setKeyProvider.
Runs a pre-call test: checks the camera and microphone, publishes them to a test server for the sampling window in options, and scores the uplink and downlink. Run it before createRoom: from that call until the room is left, the test fails with ERROR_PRECALL_AFTER_INIT. Joining a room stops a running test.
Limits the webcam auto-pause/resume to activity's stop and resume events. Without it the SDK reacts to any activity in the process, so opening a settings screen would stop the camera. See setEnableActivityLifecycle for what stopping and resuming do.
Enables (default) or disables pausing the local webcam while the app is backgrounded.
Sets how much the SDK logs to the VideoSDK.* logcat tags. Takes effect immediately and applies to the whole process.
Overrides the system audio mode the SDK runs the call in. The SDK already picks one; this is for apps that must coexist with another audio stack.
Sets, rotates or removes one participant's E2EE key, including mid-call.
Turns on the proximity sensor so holding the phone to your ear moves audio from the speaker to the earpiece, as a phone call does.
Sets how a front camera without a flash unit is lit when Participant.captureImage runs with CaptureFlash.ON.
Records which camera the SDK should treat as current. It does not open, close or switch anything — use Room.changeCam to actually move a running camera.
Sets the video effects configuration before a room is joined.
Stops the running pre-call test, if any. Asynchronous; the suspended runPreCallTest call still receives its outcome.