“startMeetingWithParams”以参与者身份开始会议 - 需要它以主持人身份开始会议: 我正在尝试使用react-native-zoom-us创建一个简单的应用程序开源项目,声称充当“zoom android sdk”的最小桥梁。通过导入“us.zoom.sdk.ZoomSDK”可以在此桥中访问 zoom android sdk。它提供的基本功能包括android sdk的MeetingService的startMeetingWithParams()函数。在代码(附在下面)中,我可以看到他们正在使用某些参数设置 StartMeetingParamsWithoutLogin(),然后将其作为参数传递给 startMeetingWithParams()。这是开始与用户作为参与者的会议(即使在参数“userId”中设置了会议的host_id)并且默认的等候室屏幕显示等待主持人开始会议,而预计会开始作为主持人开会。请对此做出您的推论,并让我知道需要做些什么来解决这个问题。StartMeetingOptions 需要做些什么吗?另外这里的 userType 参数是什么?据说对于专业用户来说是“整数:2”。但是,我不确定我是哪种类型的缩放用户。请让我知道如何了解 userType。
@ReactMethod
public void startMeeting(
final String displayName,
final String meetingNo,
final String userId,
final int userType,
final String zoomAccessToken,
final String zoomToken,
Promise promise
) {
try {
meetingPromise = promise;
ZoomSDK zoomSDK = ZoomSDK.getInstance();
if(!zoomSDK.isInitialized()) {
promise.reject("ERR_ZOOM_START", "ZoomSDK has not been initialized successfully");
return;
}
final MeetingService meetingService = zoomSDK.getMeetingService();
if(meetingService.getMeetingStatus() != MeetingStatus.MEETING_STATUS_IDLE) {
long lMeetingNo = 0;
try {
lMeetingNo = Long.parseLong(meetingNo);
} catch (NumberFormatException e) {
promise.reject("ERR_ZOOM_START", "Invalid meeting number: " + meetingNo);
return;
}
if(meetingService.getCurrentRtcMeetingNumber() == lMeetingNo) {
meetingService.returnToMeeting(reactContext.getCurrentActivity());
promise.resolve("Already joined zoom meeting");
return;
}
}
StartMeetingOptions opts = new StartMeetingOptions();
StartMeetingParamsWithoutLogin params = new StartMeetingParamsWithoutLogin();
params.displayName = displayName;
params.meetingNo = meetingNo;
params.userId = userId;
params.userType = userType;
params.zoomAccessToken = zoomAccessToken;
// params.zoomToken = zoomToken;
int startMeetingResult = meetingService.startMeetingWithParams(reactContext.getCurrentActivity(), params, opts);
Log.i(TAG, "startMeeting, startMeetingResult=" + startMeetingResult);
if (startMeetingResult != MeetingError.MEETING_ERROR_SUCCESS) {
promise.reject("ERR_ZOOM_START", "startMeeting, errorCode=" + startMeetingResult);
}
} catch (Exception ex) {
promise.reject("ERR_UNEXPECTED_EXCEPTION", ex);
}
}