ZoomMtg

ZoomMtg

Source:
Version:
  • WebSDK1.9.6

This is zoom WebSDK for web.

Namespaces

i18n

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
Name Type Attributes Default Description
zoomJSLib string <optional>
'https://source.zoom.us/1.9.6/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();
// 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
Name Type Description
apiKey string

api key

apiSecret string

api secret

meetingNumber string

meeting number

role number

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/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
Name Type Attributes Default Description
loginWindow Object

options

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

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.

isSupportPolling boolean <optional>
true

Enable or disable if you want use Meeting Polling feature.

isSupportBreakout boolean <optional>
true

Enable or disable if you want use Meeting Breakout Room 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

disablePreview boolean <optional>
false

Enable/Disable Audio and Video Preview

disableCORP boolean <optional>
true

Enable/Disable web isolation mode

inviteUrlFormat string <optional>
''

hide: hide invite url, or customer invite formate "https://your.com/?j={0}pwd={1}"

loginWindow.width int <optional>
400

Login subWindow width

loginWindow.height int <optional>
380

Login subWindow height

disableVoIP boolean <optional>
false

Enable/Disable VoIP feature

disableReport boolean <optional>
false

Enable/Disable Report feature

meetingInfo array <optional>
['topic','host','mn','pwd','telPwd','invite','participant','dc', 'enctype', 'report']

choice which meeting info want to show

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',
    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

customerKey string
tk string
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, 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
Name Type Description
phoneNumber boolean

call out number

inviteByPhone(params)

Source:

Invite by phone

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

phone number

userName string

username

inviteCRCDevice(params)

Source:

Invite CRC Device

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

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