Video SDK
class VideoSDK
The main entry point for the VideoSDK. Use this class to initialize the SDK, configure authentication, create meetings, and manage media tracks.
VideoSDK provides methods for:
- Initializing the underlying real-time communication engine
- Storing and validating the authentication token
- Creating and configuring Meeting instances
- Creating custom audio and video tracks
- Handling pre-call permissions and device discovery
- Managing audio device selection and change events
- Configuring SDK logging
Code Example:
// 1. Initialize (once, in Application or Activity)
VideoSDK.initialize(applicationContext)
// 2. Configure authentication token
VideoSDK.config("YOUR_TOKEN")
// 3. Create a meeting
val meeting = VideoSDK.initMeeting(
context, // Android context
"meetingId", // meeting ID
"John Doe", // display name
true, // mic enabled
true, // webcam enabled
null, // participant ID (auto-generated)
"SEND_AND_RECV", // mode
true, // multi-stream (simulcast)
null, // custom tracks
null // metadata
)
// 4. Join
meeting.join()
Content copied to clipboard
Types
Link copied to clipboard
interface AudioDeviceChangeEvent
Listener interface for audio device changes.
Link copied to clipboard
interface CustomTrackListener
Listener interface for asynchronous custom track creation.
Link copied to clipboard
enum PreferredProtocol
Defines the preferred network protocol for media transmission.
Properties
Link copied to clipboard
Bitrate mode for video encoding.
Link copied to clipboard
A JSON object containing all SDK error codes and their descriptions.
Link copied to clipboard
The currently selected audio input device.
Link copied to clipboard
The currently selected video (camera) device.
Link copied to clipboard
The set of available video (camera) devices detected on this device.
Functions
Link copied to clipboard
Applies a video frame processor to the outgoing video stream.
Link copied to clipboard
fun checkPermissions(context: Context, permission: List<Permission>, permissionHandler: PermissionHandler)
Checks and requests runtime permissions required by the SDK, without a rationale message or custom dialog options.
fun checkPermissions(context: Context, permission: List<Permission>, rationale: String, permissionHandler: PermissionHandler)
Checks and requests permissions with a rationale message.
fun checkPermissions(context: Context, permission: List<Permission>, options: Permissions.Options, permissionHandler: PermissionHandler)
Checks and requests permissions with custom options.
fun checkPermissions(context: Context, permission: List<Permission>, rationale: String, options: Permissions.Options, permissionHandler: PermissionHandler)
Checks and requests runtime permissions with a rationale message and custom dialog options.
Link copied to clipboard
Creates a custom audio track with the specified encoder configuration.
Link copied to clipboard
fun createCameraVideoTrack(encoderConfig: String, facingMode: String, optimizationMode: CustomStreamTrack.VideoMode, multiStream: Boolean, context: Context, videoDeviceInfo: VideoDeviceInfo): CustomStreamTrack
fun createCameraVideoTrack(encoderConfig: String, facingMode: String, optimizationMode: CustomStreamTrack.VideoMode, multiStream: Boolean, context: Context, videoDeviceInfo: VideoDeviceInfo, maxLayer: Integer): CustomStreamTrack
fun createCameraVideoTrack(encoderConfig: String, facingMode: String, optimizationMode: CustomStreamTrack.VideoMode, multiStream: Boolean, context: Context, videoDeviceInfo: VideoDeviceInfo, bitrateMode: BitrateMode): CustomStreamTrack
fun createCameraVideoTrack(encoderConfig: String, facingMode: String, optimizationMode: CustomStreamTrack.VideoMode, multiStream: Boolean, context: Context, observer: CapturerObserver, videoDeviceInfo: VideoDeviceInfo): CustomStreamTrack
fun createCameraVideoTrack(encoderConfig: String, facingMode: String, optimizationMode: CustomStreamTrack.VideoMode, multiStream: Boolean, context: Context, videoDeviceInfo: VideoDeviceInfo, maxLayer: Integer, bitrateMode: BitrateMode): CustomStreamTrack
Creates a custom camera video track with full control over simulcast layers and bitrate mode.
Link copied to clipboard
fun createScreenShareVideoTrack(encoderConfig: String, data: Intent, context: Context, listener: VideoSDK.CustomTrackListener)
Creates a screen share video track asynchronously.
Link copied to clipboard
Returns all available audio devices (speaker, earpiece, bluetooth, etc.).
Link copied to clipboard
Returns all available media devices (both audio and video).
Link copied to clipboard
Returns the current log level that controls the verbosity of client-facing Logcat output.
Link copied to clipboard
Initializes the VideoSDK.
Link copied to clipboard
fun initMeeting(context: Context, meetingId: String, name: String, micEnabled: Boolean, webcamEnabled: Boolean, @Nullable participantId: String, mode: String, multiStream: Boolean, customTracks: Map<String, CustomStreamTrack>, metaData: JSONObject): Meeting
fun initMeeting(context: Context, meetingId: String, name: String, micEnabled: Boolean, webcamEnabled: Boolean, @Nullable participantId: String, mode: String, multiStream: Boolean, customTracks: Map<String, CustomStreamTrack>, metaData: JSONObject, @Nullable signalingBaseUrl: String): Meeting
fun initMeeting(context: Context, meetingId: String, name: String, micEnabled: Boolean, webcamEnabled: Boolean, @Nullable participantId: String, mode: String, multiStream: Boolean, customTracks: Map<String, CustomStreamTrack>, metaData: JSONObject, @Nullable preferredProtocol: VideoSDK.PreferredProtocol): Meeting
fun initMeeting(context: Context, meetingId: String, name: String, micEnabled: Boolean, webcamEnabled: Boolean, @Nullable participantId: String, mode: String, multiStream: Boolean, customTracks: Map<String, CustomStreamTrack>, metaData: JSONObject, @Nullable signalingBaseUrl: String, @Nullable preferredProtocol: VideoSDK.PreferredProtocol): Meeting
Initializes and returns a Meeting instance configured with the provided parameters.
Link copied to clipboard
Removes the currently applied video frame processor.
Link copied to clipboard
Sets the activity to be used for lifecycle-based webcam management.
Link copied to clipboard
Registers a listener for audio device change events.
Link copied to clipboard
Enables or disables debug mode for the SDK.
Link copied to clipboard
Enables or disables automatic webcam management based on activity lifecycle.
Link copied to clipboard
Set the log level for SDK tracing.