-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate.js
43 lines (41 loc) · 1.05 KB
/
create.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
const meetConfig = {
apiKey: 'V0HGokKeRWKQ6-wf6e7d7A',
meetingNumber: '123456789',
leaveUrl: 'https://yoursite.com/meetingEnd',
userName: '',
passWord: 'password',
role: 1 // 1 for host
};
// import { ZoomMtg } from '@zoomus/websdk'
// prepare required files
ZoomMtg.preLoadWasm();
ZoomMtg.prepareJssdk();
getSignature(meetConfig) {
// make a request for a signature
fetch('${YOUR_SIGNATURE_ENDPOINT}', {
method: 'POST',
body: JSON.stringify({ meetingData: meetConfig })
})
.then(result => result.text())
.then(response => {
// call the init method with meeting settings
ZoomMtg.init({
leaveUrl: meetConfig.leaveUrl,
isSupportAV: true,
// on success, call the join method
success: function() {
ZoomMtg.join({
// pass your signature response in the join method
signature: response,
apiKey: meetConfig.apiKey,
meetingNumber: meetConfig.meetingNumber,
userName: meetConfig.userName,
passWord: meetConfig.passWord
error(res) {
console.log(res)
}
})
}
})
}
}