- Source:
- Version:
- WebSDK1.9.6
- Copyright:
- Zoom 2021
This is zoom WebSDK for web.
Namespaces
Methods
setZoomJSLib(params)
- Source:
change zoom default requirements lib resource
Example
ZoomMtg.setZoomJSLib('https://source.zoom.us/1.9.6/lib', '/av');
AVFiles = {
audioWorkerPath: `${zoomJSLib}${zoomJSAVLib}/${jsmediaVersion}_js_audio_process.min.js`,
audioWorkletPath: `${zoomJSLib}${zoomJSAVLib}/${jsmediaVersion}_js_audio_worklet.min.js`,
videoWorkerPath: `${zoomJSLib}${zoomJSAVLib}/${jsmediaVersion}_video_s.min.js`,
videoMtWorkerPath: `${zoomJSLib}${zoomJSAVLib}/${jsmediaVersion}_video_m.min.js`,
sharingWorkerPath: `${zoomJSLib}${zoomJSAVLib}/${jsmediaVersion}_sharing_s.min.js`,
sharingMtWorkerPath: `${zoomJSLib}${zoomJSAVLib}/${jsmediaVersion}_sharing_m.min.js`,
videoSIMDWorkerPath: `${zoomJSLib}${zoomJSAVLib}/${jsmediaVersion}_video_simd.min.js`,
sharingSIMDWorkerPath: `${zoomJSLib}${zoomJSAVLib}/${jsmediaVersion}_sharing_simd.min.js`,
};
WasmFiles = {
encode: `${zoomJSLib}${zoomJSAVLib}/audio.encode.wasm`,
decode: `${zoomJSLib}${zoomJSAVLib}/video.decode.wasm`,
decodeMt: `${zoomJSLib}${zoomJSAVLib}/video.mt.wasm`,
decodeSimd: `${zoomJSLib}${zoomJSAVLib}/video.simd.wasm`,
};
Parameters:
Name | Type | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object | options Properties
|
preLoadWasm()
- Source:
preload wasm file if wasm download error, the 2AV feature don't work wasm file(big) to browser cache, reduce customer download those file time and improve joining experience
Example
ZoomMtg.preLoadWasm();
// avMediaVersion can't change, every websdk version has a specific avMediaVersion
// pre load wasm success: ${zoomJSLib}${zoomJSAVLib}/av/{avMediaVersion}_sharing.wasm
// pre load wasm success: ${zoomJSLib}${zoomJSAVLib}/av/{avMediaVersion}_audio.encode.wasm
// pre load wasm success: ${zoomJSLib}${zoomJSAVLib}/av/{avMediaVersion}_video.decode.wasm
prepareWebSDK()
- Source:
add script to download requirements js file and node to body
Example
ZoomMtg.prepareWebSDK();
// 1. add script to download requirements js file
// for IE
// <script type="text/javascript" src="${zoomJSLib}${zoomJSAVLib}/av/../{avMediaVersion}_webim.min.js"></script>
// <script type="text/javascript" src="${zoomJSLib}${zoomJSAVLib}/av/{avMediaVersion}_js_media_ie.min.js"></script>
// for No IE
// <script type="text/javascript" src="${zoomJSLib}${zoomJSAVLib}/av/../{avMediaVersion}_webim.min.js"></script>
// <script type="text/javascript" src="${zoomJSLib}${zoomJSAVLib}/av/{avMediaVersion}_js_media.min.js"></script>
// 2. add a node which WebSDK use
// <div id="zmmtg-root">
// <div data-reactroot="" class="meeting-app"></div>
// </div>
// react modal auto generation.
// <div class="ReactModalPortal"></div>
generateSignature(params) → {string}
- Source:
A quick test way to generate signature, get an api https://marketplace.zoom.us/docs/sdk/native-sdks/web/essential/signature introduce get API https://www.visibility.one/support/zoom-api-how-to-get-your-api-from-the-zoom-marketplace backe-end to genarate signature go to see generate_signature in php
Example
//source code generateSignature
import * as base64JS from 'js-base64';
import * as hmacSha256 from 'crypto-js/hmac-sha256';
import * as encBase64 from 'crypto-js/enc-base64';
function generateSignature(data) {
let signature = '';
// Prevent time sync issue between client signature generation and zoom
const ts = new Date().getTime() - 30000;
try {
const msg = base64JS.Base64.encode(data.apiKey + data.meetingNumber + ts + data.role);
const hash = hmacSha256.default(msg, data.apiSecret);
signature = base64JS.Base64.encodeURI(`${data.apiKey}.${data.meetingNumber}.${ts}.${data.role}.${encBase64.stringify(hash)}`);
} catch (e) {
console.log('error')
}
return signature;
}
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object | options Properties
|
Returns:
return signature
- Type
- string
checkSystemRequirements(printopt) → {Object}
- Source:
check zoom WebSDK features for customer's browser
Example
ZoomMtg.checkSystemRequirements()
//ie 9 example check fail
false
//chrome example check success
{
"browserInfo": "Chrome/87.0.4280.88",
"browserName": "Chrome",
"browserVersion": "87.0.4280.88",
"features": ["viewSharing", "computerAudio", "computerVideo", "callIn", "callOut", "chat", "closedCaption", "QA", "POLLING", "BREAKOUT"]
}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
print |
Boolean |
<optional> |
true
|
whether console log check info |
Returns:
return check result, return false when check fail
- Type
- Object
getWebSDKVersion() → {Array}
- Source:
get WebSDK version
Examples
ZoomMtg.getWebSDKVersion()
["1.9.6", "1.9.6", 6331]
Returns:
return WebSDK version number. old getJSSDKVersion will remove very soon
- Type
- Array
init(params)
- Source:
Init Zoom Meeting
Example
ZoomMtg.init({
debug: true, //optional
leaveUrl: 'http://www.zoom.us', //required
webEndpoint: 'PSO web domain', // PSO option
showMeetingHeader: false, //option
disableInvite: false, //optional
disableCallOut: false, //optional
disableRecord: false, //optional
disableJoinAudio: false, //optional
audioPanelAlwaysOpen: true, //optional
showPureSharingContent: false, //optional
isSupportAV: true, //optional,
isSupportChat: true, //optional,
isSupportQA: true, //optional,
isSupportPolling: true, //optional
isSupportBreakout: true, //optional
isSupportCC: true, //optional,
screenShare: true, //optional,
rwcBackup: '', //optional,
videoDrag: true, //optional,
sharingMode: 'both', //optional,
videoHeader: true, //optional,
isLockBottom: true, // optional,
isSupportNonverbal: true, // optional,
isShowJoiningErrorDialog: true, // optional,
disablePreview: false, // optional
disableCORP: true, // optional
inviteUrlFormat: '', // optional
loginWindow: { // optional,
width: 400,
height: 380
},
meetingInfo: [ // optional
'topic',
'host',
'mn',
'pwd',
'telPwd',
'invite',
'participant',
'dc',
'enctype',
'report'
],
disableVoIP: false, // optional
disableReport: false, // optional
});
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object | options Properties
|
join(params)
- Source:
Example
ZoomMtg.join({
meetingNumber: 123456789,
userName: 'User name',
userEmail: '',
passWord: '',
apiKey: 'API_KEY',
signature: 'SIGNATURE',
success: function(res){console.log(res)},
error: function(res){console.log(res)}
});
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object | options Properties
|
showInviteFunction(params)
- Source:
Show or hide invite function
Example
ZoomMtg.showInviteFunction({
show: true
});
Parameters:
Name | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
showMeetingHeader(params)
- Source:
Show/Hide meeting header
Example
ZoomMtg.showMeetingHeader({
show: false
});
Parameters:
Name | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
showRecordFunction(params)
- Source:
Show/Hide record function
Example
ZoomMtg.showRecordFunction({
show: false
});
Parameters:
Name | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
showCalloutFunction(params)
- Source:
Show/Hide call out function
Example
ZoomMtg.showCalloutFunction({
show: false
});
Parameters:
Name | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
showJoinAudioFunction(params)
- Source:
Show/Hide join audio function
Example
ZoomMtg.showJoinAudioFunction({
show: false
});
Parameters:
Name | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
showPureSharingContent(params)
- Source:
Will not cover sharing content when set show as true
Example
ZoomMtg.showPureSharingContent({
show: false
});
Parameters:
Name | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
getAttendeeslist(params)
- Source:
Get current attendees list, inde 0 is current user
Example
only support meeting
ZoomMtg.getAttendeeslist({});
Parameters:
Name | Type | Description |
---|---|---|
params |
Object |
getBreakoutRoomList(params)
- Source:
Get Breakout Room list and attendees
Example
only support meeting
ZoomMtg.getBreakoutRoomList({});
Parameters:
Name | Type | Description |
---|---|---|
params |
Object |
getCurrentUser(params)
- Source:
Get current user
Example
ZoomMtg.getCurrentUser({});
Parameters:
Name | Type | Description |
---|---|---|
params |
Object |
getCurrentMeetingInfo(params)
- Source:
Get current user
Example
ZoomMtg.getCurrentMeetingInfo({});
Parameters:
Name | Type | Description |
---|---|---|
params |
Object |
inMeetingServiceListener(event, callback)
- Source:
In meeting event
Example
only support meeting
ZoomMtg.inMeetingServiceListener('onUserJoin', function (data) {
console.log(data);
});
only support meeting
ZoomMtg.inMeetingServiceListener('onUserLeave', function (data) {
console.log(data);
});
ZoomMtg.inMeetingServiceListener('onUserIsInWaitingRoom', function (data) {
console.log(data);
});
ZoomMtg.inMeetingServiceListener('onMeetingStatus', function (data) {
// {status: 1(connecting), 2(connected), 3(disconnected), 4(reconnecting)}
console.log(data);
});
Parameters:
Name | Type | Description |
---|---|---|
event |
string | event name |
callback |
function | callback function |
callOut(params)
- Source:
The method will invite yourself to join meeting by phone
Example
ZoomMtg.callOut({
phoneNumber: '+1800...'
});
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
inviteByPhone(params)
- Source:
Invite by phone
Example
ZoomMtg.inviteByPhone({
phoneNumber: '+11111111',
userName: 'username'
});
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
inviteCRCDevice(params)
- Source:
Invite CRC Device
Example
ZoomMtg.inviteCRCDevice({
ip: '10.100.80.98',
type: 1
});
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
mute(params)
- Source:
mute attendee
Example
ZoomMtg.mute({
userId: 16797696,
mute: true
});
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
muteAll(params)
- Source:
mute/unmute all attendee, the role must bee has this proviliage
Example
ZoomMtg.muteAll({
muteAll: true
});
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
rename(params)
- Source:
rename attendee name, the role must bee has this proviliage userId and oldName must bee right, otherwise you can't modify success
Example
ZoomMtg.rename({
userId: 123456,
oldName: 'ole name',
newName: 'new name'
});
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
expel(params)
- Source:
kickoff attendee, must have proliliage
Example
ZoomMtg.expel({
userId: 123456
});
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
record(params)
- Source:
record/disrecord meeting, host only
Example
ZoomMtg.record({
record: true
});
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
lockMeeting(params)
- Source:
lock/unlock meeting, others can't join this meeting unless unlock meeting
Example
ZoomMtg.lockMeeting({
lockMeeting: true
});
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
leaveMeeting(params)
- Source:
leave meeting, if host leave, the meeting will end.
Example
ZoomMtg.leaveMeeting({});
Parameters:
Name | Type | Description |
---|---|---|
params |
Object |
endMeeting(params)
- Source:
end meeting
Example
ZoomMtg.endMeeting({});
Parameters:
Name | Type | Description |
---|---|---|
params |
Object |
putOnHold(params)
- Source:
allow attendee to joining meeting
Example
ZoomMtg.putOnHold({
userId: 123456,
hold: true
});
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
Type Definitions
successCallback(res)
- Source:
Properties:
Name | Type | Description |
---|---|---|
res.method |
string | API Method |
res.status |
boolean | Status of call |
res.errorCode |
int | Error Code errorCodes |
res.errorMessage |
string | Error message errorCodes |
res.result |
Object | Response result object |
Success Callback
Parameters:
Name | Type | Description |
---|---|---|
res |
Object | Response Object |
errorCallback(res)
- Source:
Properties:
Name | Type | Description |
---|---|---|
res.method |
string | API Method |
res.status |
boolean | Status of call |
res.errorCode |
int | Error Code errorCodes |
res.errorMessage |
string | Error message errorCodes |
res.result |
Object | Response result object |
Error Callback
Parameters:
Name | Type | Description |
---|---|---|
res |
Object | Response Object |