-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathclient-view.js
66 lines (61 loc) · 1.36 KB
/
client-view.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
ZoomMtg.preLoadWasm()
ZoomMtg.prepareWebSDK()
var authEndpoint = ''
var sdkKey = ''
var meetingNumber = '123456789'
var passWord = ''
var role = 0
var userName = 'JavaScript'
var userEmail = ''
var registrantToken = ''
var zakToken = ''
var leaveUrl = 'https://zoom.us'
function getSignature() {
fetch(authEndpoint, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
meetingNumber: meetingNumber,
role: role
})
}).then((response) => {
return response.json()
}).then((data) => {
console.log(data)
startMeeting(data.signature)
}).catch((error) => {
console.log(error)
})
}
function startMeeting(signature) {
document.getElementById('zmmtg-root').style.display = 'block'
ZoomMtg.init({
leaveUrl: leaveUrl,
patchJsMedia: true,
leaveOnPageUnload: true,
success: (success) => {
console.log(success)
ZoomMtg.join({
signature: signature,
sdkKey: sdkKey,
meetingNumber: meetingNumber,
passWord: passWord,
userName: userName,
userEmail: userEmail,
tk: registrantToken,
zak: zakToken,
success: (success) => {
console.log(success)
},
error: (error) => {
console.log(error)
},
})
},
error: (error) => {
console.log(error)
}
})
}