Initializing a Meeting - Android
initialize()
To initialize the meeting, first you have to initialize the VideoSDK.
You can initialize the VideoSDK using initialize() method provided by the SDK.
Parameters
- context: Context
Returns
void
VideoSDK.initialize(Context context)
config()
Now, you have to set token property of VideoSDK class.
By using config() method, you can set the token property of VideoSDK class.
Please refer this documentation to generate a token.
Parameters
- token: String
Returns
void
VideoSDK.config(String token)
initMeeting()
- Now, you can initialize the meeting using a factory method provided by the SDK called
initMeeting(). initMeeting()will generate a newMeetingclass and the initiated meeting will be returned.
VideoSDK.initMeeting(
Context context,
String meetingId,
String name,
boolean micEnabled,
boolean webcamEnabled,
String participantId,
String mode,
boolean multiStream,
Map<String, CustomStreamTrack> customTracks
JSONObject metaData,
String signalingBaseUrl,
PreferredProtocol preferredProtocol
)
Parameters
context
-
Context of activity.
- type : Context
REQUIRED
meetingId
-
Unique Id of the meeting where that participant will be joining.
- type :
String REQUIRED
- type :
Please refer this documentation to create a room.
name
-
Name of the participant who will be joining the meeting, this name will be displayed to other participants in the same meeting.
- type : String
REQUIRED
micEnabled
-
Whether
micof the participant will be on while joining the meeting. If it is set tofalse, then mic of that participant will bedisabledby default, but can beenabledordisabledlater.- type:
Boolean REQUIRED
- type:
webcamEnabled
-
Whether
webcamof the participant will be on while joining the meeting. If it is set tofalse, then webcam of that participant will bedisabledby default, but can beenabledordisabledlater.- type:
Boolean REQUIRED
- type:
participantId
-
Unique Id of the participant. If you passed
nullthen SDK will create an Id by itself and will use that id.- type :
Stringornull REQUIRED
- type :
Modes
There are three modes available:
-
SEND_AND_RECV: In this mode, both audio and video streams will be produced and consumed. -
SIGNALLING_ONLY: In this mode, no audio or video streams will be produced or consumed. It is used solely for signaling. -
RECV_ONLY: This mode allows only the consumption of audio and video streams without producing any.
Type: String or null
Default Value: SEND_AND_RECV
Important Changes Android SDK in Version v0.2.0
- The following modes have been deprecated:
CONFERENCEhas been replaced bySEND_AND_RECVVIEWERhas been replaced bySIGNALLING_ONLY
Please update your implementation to use the new modes.
⚠️ Compatibility Notice:
To ensure a seamless meeting experience, all participants must use the same SDK version.
Do not mix version v0.2.0 + with older versions, as it may cause significant conflicts.
multiStream
-
It will specify if the stream should send multiple resolution layers or single resolution layer.
- type:
boolean REQUIRED
- type:
customTracks
-
If you want to use custom tracks from start of the meeting, you can pass map of custom tracks in this paramater.
- type :
Map<String, CustomStreamTrack>ornull REQUIRED
- type :
Please refer this documentation to know more about CustomTrack.
metaData
-
If you want to provide additional details about a user joining a meeting, such as their profile image, you can pass that information in this parameter.
- type:
JSONObject REQUIRED
- type:
signalingBaseUrl
-
If you want to use a proxy server with the VideoSDK, you can specify your baseURL here.
- type:
String OPTIONAL
- type:
If you intend to use a proxy server with the VideoSDK, priorly inform us at support@videosdk.live
preferredProtocol
-
If you want to provide a preferred network protocol for communication, you can specify that in
PreferredProtocol, with options includingUDP_ONLY,UDP_OVER_TCP, andTCP_ONLY.- type:
PreferredProtocol OPTIONAL
- type:
Returns
meeting
- After initializing the meeting,
initMeeting()will return a newMeetinginstance.
Example
- Kotlin
- Java
VideoSDK.initialize(applicationContext)
// Configure the token
VideoSDK.config(token) // pass the token generated from VideoSDK Dashboard
// Initialize the meeting
var meeting = VideoSDK.initMeeting(
arrayOf(
this@MainActivity,
"abc-1234-xyz",
"John Doe",
true,
true,
null,
null,
false,
null,
null
)
)
VideoSDK.initialize(getApplicationContext());
// Configure the token
VideoSDK.config(token); // pass the token generated from VideoSDK Dashboard
// Initialize the meeting
Meeting meeting = VideoSDK.initMeeting({
MainActivity.this,
"abc-1234-xyz",
"John Doe",
true,
true,
null,
null,
false,
null,
null,
null
});
Got a Question? Ask us on discord

