VideoSDK

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()

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
Listener interface for audio device changes.
Link copied to clipboard
Listener interface for asynchronous custom track creation.
Link copied to clipboard
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
Maximum number of simulcast layers for video tracks.
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 authentication token used for API requests and meeting creation.
Link copied to clipboard
The set of available video (camera) devices detected on this device.

Functions

Link copied to clipboard
fun applyVideoProcessor(videoFrameProcessor: VideoFrameProcessor)
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
fun config(token: String)
Configures the authentication token for the SDK.
Link copied to clipboard
fun createAudioTrack(encoderConfig: String, context: Context): CustomStreamTrack
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
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
fun initialize(context: Context)
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
fun setDebugMode(debugMode: Boolean)
Enables or disables debug mode for the SDK.
Link copied to clipboard
fun setEnableActivityLifecycle(enableActivityLifecycle: Boolean)
Enables or disables automatic webcam management based on activity lifecycle.
Link copied to clipboard
fun setLogLevel(level: LogLevel)
Set the log level for SDK tracing.