ZoomMtg

ZoomMtg

Source:
Version:
  • WebSDK1.7.0

This is zoom WebSDK for web.

Methods

setZoomJSLib(params)

Source:

change zoom default requirements lib resource

Example
ZoomMtg.setZoomJSLib('https://source.zoom.us/1.7.0/lib', '/av');
//AVFiles = {
//  audioEncWorkerPath: `${zoomJSLib}${zoomJSAVLib}/js_audio_process.min.js`,
//  audioDecWorkerPath: `${zoomJSLib}${zoomJSAVLib}/js_audio_process.min.js`,
//  videoDecWorkerPath: `${zoomJSLib}${zoomJSAVLib}/js_video_dec.min.js`,
//  videoEncWorkerPath: `${zoomJSLib}${zoomJSAVLib}/js_video_dec.min.js`,
//  imageDecWorkerPath: `${zoomJSLib}${zoomJSAVLib}/sharing.min.js`,
//  audioWorkerPath: `${zoomJSLib}${zoomJSAVLib}/js_audio_worklet.min.js`
//};

//WasmFiles = {
//  encode: `${zoomJSLib}${zoomJSAVLib}/audio.encode.wasm`,
//  decode: `${zoomJSLib}${zoomJSAVLib}/video.decode.wasm`,
//  sharing: `${zoomJSLib}${zoomJSAVLib}/sharing.wasm`,
//};
Parameters:
Name Type Description
params Object

options

Properties
Name Type Attributes Default Description
zoomJSLib string <optional>
'https://source.zoom.us/1.7.0/lib'

default use ES5

zoomJSAVLib string <optional>
'/av'

default build var

zoomJSLib string <optional>
'YouWebSite/node_modules/@zoomus/websdk/dist/lib'

default use ES6 import feature

zoomJSAVLib string <optional>
'/av'

default build var

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();
// pre load wasm success: ${zoomJSLib}${zoomJSAVLib}/av/sharing.wasm
// pre load wasm success: ${zoomJSLib}${zoomJSAVLib}/av/audio.encode.wasm
// pre load wasm success: ${zoomJSLib}${zoomJSAVLib}/av/video.decode.wasm

prepareJssdk()

Source:

add script to download requirements js file and node to body

Example
ZoomMtg.prepareJssdk();

// 1. add script to download requirements js file
// for IE
// <script type="text/javascript" src="${zoomJSLib}${zoomJSAVLib}/av/../webim.min.js"></script>
// <script type="text/javascript" src="${zoomJSLib}${zoomJSAVLib}/av/js_media_ie.min.js"></script>
// for No IE
// <script type="text/javascript" src="${zoomJSLib}${zoomJSAVLib}/av/../webim.min.js"></script>
// <script type="text/javascript" src="${zoomJSLib}${zoomJSAVLib}/av/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 marketplace 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 = '';
    const ts = new Date().getTime();
    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
Name Type Description
apiKey Object

api key

apiSecret Object

api secret

meetingNumber Object

meeting number

role Object

1 is host, 0 is attendee, webinar just support 0

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/70.0.3538.110",
"browserName": "Chrome",
"browserVersion": "70.0.3538.110",
"features": ["viewSharing", "computerAudio", "computerVideo", "callIn", "callOut"]
}
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

getJSSDKVersion() → {Array}

Source:

get WebSDK version

Examples
ZoomMtg.getJSSDKVersion()
["1.7.0", "version_{date}_releaseType_stage - {date}"]
Returns:

return WebSDK version number

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
    rwcEndpoint: 'PSO rwc domain', // PSO option
    rwcBackup: 'PSO multi rwc 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,
    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
    });
Parameters:
Name Type Description
params Object

options

Properties
Name Type Attributes Default Description
debug boolean <optional>
false

Turn on debug mode can print log in browser console log

leaveUrl string

required, Post message page url after leave meeting, like “http://www.zoom.us”

webEndpoint string <optional>

web domain option for PSO ENV, contract with zoom PSO supporter

rwcEndpoint string <optional>

rwc domain option for PSO ENV, contract with zoom PSO supporter

rwcBackup string <optional>

multi domain option for PSO ENV, contract with zoom PSO supporter(if null set '', multi rwc split with ';', such as 'domain1;domain2')

showMeetingHeader boolean <optional>
true

Show or hide the meeting header, includes meeting number and topic

disableInvite boolean <optional>
false

Enable or disable invite function.

disableCallOut boolean <optional>
false

Enable or disable call out function.

disableRecord boolean <optional>
false

Enable or disable record function.

disableJoinAudio boolean <optional>
false

Enable or disable join audio function.

audioPanelAlwaysOpen boolean <optional>
false

Set the default state of the audio panel on join.

isSupportAV boolean <optional>
true

Enable or disable if you want use audio and video feature.

isSupportChat boolean <optional>
true

Enable or disable if you want use chat feature.

isSupportQA boolean <optional>
true

Enable or disable if you want use Webinar Q&A feature.

isSupportCC boolean <optional>
true

Enable or disable if you want use Meeting Closed Caption feature.

screenShare boolean <optional>
true

Enable or disable if you want use browser feature(only chrome).

rwcBackup boolean <optional>
''

rwc domain, if set enable multi-rwc feature

videoDrag boolean <optional>
true

Enable drag video tile

sharingMode boolean <optional>
'both'

'fit' - disable sharing "origin size"

videoHeader boolean <optional>
true

Enable show video tile header

isLockBottom boolean <optional>
true

alway show footer or auto hide footer

isSupportNonverbal boolean <optional>
true

Enable/Disable Noverbal feedback feature

isShowJoiningErrorDialog boolean <optional>
true

Enable/Disable Join error popup dialog when join meeting fail

success ZoomMtg.successCallback <optional>

Call back function on success

error ZoomMtg.errorCallback <optional>

Call back function on error // * @gifs gif1;gif2 - / ;en/1.5.1/images/tenor.gif;http://localhost:9999/images/tenor.gif

join(params)

Source:
Example
ZoomMtg.join({
    meetingNumber: 123456789,
    userName: 'User name',
    userEmail: '',
    passWord: '',
    apiKey: 'API_KEY',
    signature: 'SIGNATURE',
    participantId: 'UUID',
    success: function(res){console.log(res)},
    error: function(res){console.log(res)}
 });
Parameters:
Name Type Description
params Object

options

Properties
Name Type Attributes Description
meetingNumber int

required

userName string

required

userEmail string

Webinar required

passWord string

required

signature string

required

apiKey string

required

success ZoomMtg.successCallback <optional>

Call back function on success

error ZoomMtg.errorCallback <optional>

Call back function on error

showInviteFunction(params)

Source:

Show or hide invite function

Example
ZoomMtg.showInviteFunction({
    show: true
});
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Default Description
show boolean <optional>
true

default true, required

showMeetingHeader(params)

Source:

Show/Hide meeting header

Example
ZoomMtg.showMeetingHeader({
	show: false
 });
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Default Description
show boolean <optional>
true

default true, required

showRecordFunction(params)

Source:

Show/Hide record function

Example
ZoomMtg.showRecordFunction({
	show: false
 });
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Default Description
show boolean <optional>
true

default true, required

showCalloutFunction(params)

Source:

Show/Hide call out function

Example
ZoomMtg.showCalloutFunction({
	show: false
 });
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Default Description
show boolean <optional>
true

default true, required

showJoinAudioFunction(params)

Source:

Show/Hide join audio function

Example
ZoomMtg.showJoinAudioFunction({
	show: false
 });
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Default Description
show boolean <optional>
true

default true, required

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
Name Type Attributes Default Description
show boolean <optional>
true

default true, required

getAttendeeslist(params)

Source:

Get current attendees list

Example
ZoomMtg.getAttendeeslist({});
Parameters:
Name Type Description
params Object

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
Name Type Description
phoneNumber boolean

call out number

getZoomRoomlist(params)

Source:

Get list of Zoom Rooms

Example
ZoomMtg.getZoomRoomlist({
  success: function (res) {
    console.log(res);
  }
});
Parameters:
Name Type Description
params Object
Properties
Name Type Description
success function

Call back function on success

inviteByPhone(params)

Source:

Invite Zoom Room

Example
ZoomMtg.inviteByPhone({
    phoneNumber: '+8618625244063',
    userName: 'liuyikun'
});
Parameters:
Name Type Description
params Object
Properties
Name Type Description
phoneNumber string

phone number

userName string

username

inviteZoomRoom(params)

Source:

Invite Zoom Room

Example
ZoomMtg.inviteZoomRoom({
  zoomRoom: 'room'
});
Parameters:
Name Type Description
params Object
Properties
Name Type Description
zoomRoom string

-

inviteCRCDevice(params)

Source:

Invite Zoom Room

Example
ZoomMtg.inviteCRCDevice({
    ip: '10.100.80.98',
    type: 1
});
Parameters:
Name Type Description
params Object
Properties
Name Type Description
ip string

CRC device ip

type int

device type

inviteCRCDevice(params)

Source:

Invite Zoom Room

Example
ZoomMtg.cancelInviteCRCDevice({});
Parameters:
Name Type Description
params Object

inviteZoomRoom(params)

Source:

Invite Zoom Room

Example
ZoomMtg.inviteZoomRoom({
  zoomRoom: 'room'
});
Parameters:
Name Type Description
params Object
Properties
Name Type Description
show boolean

default true, required

mute(params)

Source:

mute attendee

Example
ZoomMtg.mute({
    userId: 16797696,
    mute: true
});
Parameters:
Name Type Description
params Object
Properties
Name Type Description
userId int

userId

mute boolean

true or false

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
Name Type Description
muteAll boolean

true or false

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
Name Type Description
userId int

userId

oldName string

ole name

newName string

new name

expel(params)

Source:

kickoff attendee, must have proliliage

Example
ZoomMtg.expel({
    userId: 123456
});
Parameters:
Name Type Description
params Object
Properties
Name Type Description
userId int

expel user id

record(params)

Source:

record/disrecord meeting, host only

Example
ZoomMtg.record({
    record: true
});
Parameters:
Name Type Description
params Object
Properties
Name Type Description
record boolean

true or false

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
Name Type Description
lockMeeting boolean

true=lock meeting or false=unlock

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
Name Type Description
userId int

user id

hold boolean

true= put attendee to waiting room. false=let him join meeting

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