Start a meeting for a non-logged in or API user
The code on this page works with either the default UI or the custom UI.
After getting the Zoom Access Key (ZAK) token, pass it to start meetings with either a meeting number or a vanity ID.
Start with a meeting number
To start a meeting with meeting number, first get a MeetingService instance from ZoomSDK.
int ret = -1;
MeetingService meetingService = mZoomSDK.getMeetingService();
if(meetingService == null) {
return ret;
}
Then configure StartMeetingOptions and prepare StartMeetingParamsWithoutLogin.
StartMeetingOptions opts =ZoomMeetingUISettingHelper.getMeetingOptions();
StartMeetingParamsWithoutLogin params = new StartMeetingParamsWithoutLogin();
Store the user ID, Zoom Access Key (zoomAccessToken), display name, and
meeting number in the StartMeetingParamsWithoutLogin instance, and
start the meeting by calling startMeetingWithParams method.
APIUserInfo userInfo = APIUserInfoHelper.getAPIUserInfo();
if (userInfo != null) {
params.userId = userInfo.userId;
params.zoomToken = userInfo.userZoomToken;
params.userType = STYPE;
params.displayName = DISPLAY_NAME;
params.zoomAccessToken = userInfo.userZoomAccessToken;
params.meetingNo = meetingNo;
ret = meetingService.startMeetingWithParams(context, params, opts);
Log.i(TAG, "startMeetingWithNumber, ret=" + ret);
}
return ret;
Start with a vanity ID
Vanity ID is a personalized ID that uniquely belongs to a user.
To start a meeting with a vanity ID, the process is almost the same as starting a meeting with a meeting number. Just store the vanity ID inside the StartMeetingParamsWithoutLogin instance instead of the meeting number.
int ret = -1;
MeetingService meetingService = mZoomSDK.getMeetingService();
if(meetingService == null) {
return ret;
}
StartMeetingOptions opts = ZoomMeetingUISettingHelper.getMeetingOptions();
StartMeetingParamsWithoutLogin params = new StartMeetingParamsWithoutLogin();
APIUserInfo userInfo = APIUserInfoHelper.getAPIUserInfo();
if (userInfo != null) {
params.userId = userInfo.userId;
params.zoomToken = userInfo.userZoomToken;
params.userType = STYPE;
params.displayName = DISPLAY_NAME;
params.zoomAccessToken = userInfo.userZoomAccessToken;
params.vanityID = vanityId;
ret = meetingService.startMeetingWithParams(context, params, opts);
Log.i(TAG, "startMeetingWithVanityId, ret=" + ret);
}
return ret;
Start meeting status
To know whether the start meeting action succeeded, didn't succeed, or resulted in an error, implement the onMeetingStatusChange method.
@Override
public void onMeetingStatusChanged(MeetingStatus meetingStatus, int errorCode,
int internalErrorCode) {
Log.i(TAG, "onMeetingStatusChanged, meetingStatus=" + meetingStatus + ", errorCode=" + errorCode
+ ", internalErrorCode=" + internalErrorCode);
if(meetingStatus == MeetingStatus.MEETING_STATUS_FAILED && errorCode == MeetingError.MEETING_ERROR_CLIENT_INCOMPATIBLE) {
Toast.makeText(this, "Version of ZoomSDK is too low!", Toast.LENGTH_LONG).show();
}
}