VideoSDK Class
The entry point into real-time communication SDK.
using VideoSDK Class
The VideoSDK Class includes methods and events to initialize and configure the SDK. It is a factory class.
initialize(), config() and initMeeting() are regular functions. meeting.join() and most other meeting actions are suspend functions, so call them from a coroutine.
For every method, property and event of VideoSDK, see VideoSDK Class.
Parameters
These are the main parameters of initMeeting(). Only context and meetingId are required. For the other optional parameters, such as mode, multiStream, customTracks and metaData, see Initializing a Meeting.
contextrequired
Contextany Android context; only its application context is keptmeetingIdrequired
Stringset meeting id; an empty id throws VideoSDKException 3073 (ERROR_INVALID_PARAMETER)nameoptional
String?(default:null)set local participant's name; if null, the name is emptymicEnabledoptional
Boolean(default:true)set local participant's mic state when joiningwebcamEnabledoptional
Boolean(default:true)set local participant's webcam state when joiningparticipantIdoptional
String?(default:null)set local participant's Id; if null or empty, one is generated
Methods
initialize(context: Context)
Unitinitialize the SDK; call it once before any other VideoSDK method, for example in Application.onCreate()config(token: String?)
Unitconfigure the token; a null or empty token throws VideoSDKException 3073 (ERROR_INVALID_PARAMETER)initMeeting( context: Context, meetingId: String, name: String? = null, micEnabled: Boolean = true, webcamEnabled: Boolean = true, participantId: String? = null, ... )
Meetinginitialize the meeting; nothing connects until you call meeting.join()
Example
initMeeting
// Initialize the SDK
VideoSDK.initialize(applicationContext)
// Configure the token
VideoSDK.config(token)
// Initialize the meeting
val meeting = VideoSDK.initMeeting(
context = this, // required
meetingId = meetingId, // required
name = name,
micEnabled = micEnabled,
webcamEnabled = webcamEnabled,
)
// Join the meeting from a coroutine
lifecycleScope.launch {
try {
meeting.join()
} catch (e: VideoSDKException) {
Log.e("VideoSDK", "Join failed: ${e.code} ${e.name}")
}
}
Got a Question? Ask us on discord

