-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.js
75 lines (67 loc) · 2.6 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import { NativeModules } from 'react-native';
const { RNMobileRTC } = NativeModules;
const { UserTypes } = RNMobileRTC;
const DEFAULT_MEETING_OPTIONS = {
meetingNumber: '',
pwd: '',
participantId: '',
userName: '',
};
export default {
...RNMobileRTC,
/**
* Initializes the Zoom SDK by signing it with SDK Auth.
* Call this when you app is mounting.
* @param {String} sdkKey SDK key created on https://developer.zoom.us/me/#sdk
* @param {String} sdkSecret SDK secret associated with SDK key
* @param {String} [sdkDomain='zoom.us'] SDK domain, defaults to zoom.us
* @returns {Promise} A promise represents a result of SDK Authentication.
* Catch and handle error types from AuthError object
*/
initialize(sdkKey, sdkSecret, sdkDomain = 'zoom.us') {
return RNMobileRTC.initialize(sdkKey, sdkSecret, sdkDomain);
},
/**
* Starts the new meeting
* @param {Object} options Meeting options
* @param {String} options.meetingNumber Meeting number
* @param {String} options.userName Users' name to be displayed at a meeting
* @param {String} [options.pwd] Meeting password
* @param {String} [options.participantId] Participant ID
* @param {String} [optons.userType=UserTypes.ZOOM_USER] API_USER, ZOOM_USER or SSO_USER user type
* from UserTypes object
* @param {String} [options.userId] User ID from Zoom REST API, send it only
* when using API_USER UserType
* @param {String} [options.userToken] User Token from Zoom REST API, send it only
* when using API_USER UserType
* @returns {Promise} A promise that represents a result of starting the meeting
* if resulted with error. Catch and handle error types from MeetingError object
*/
startMeeting(options) {
const meetingOptions = {
...DEFAULT_MEETING_OPTIONS,
userType: UserTypes.ZOOM_USER,
userId: '',
userToken: '',
...options,
};
return RNMobileRTC.startMeeting(meetingOptions);
},
/**
* Join existing meeting with meeting options
* @param {Object} options Meeting options
* @param {String} options.meetingNumber Meeting number
* @param {String} options.userName Users' name to be displayed at a meeting
* @param {String} [options.pwd] Meeting password
* @param {String} [options.participantId] Participant ID
* @returns {Promise} A promise that represents a result of joining the meeting
* if resulted with error. Catch and handle error types from MeetingError object
*/
joinMeeting(options) {
const meetingOptions = {
...DEFAULT_MEETING_OPTIONS,
...options,
};
return RNMobileRTC.joinMeeting(meetingOptions);
},
};