I aim to ensure that every participant who is not a host gets approved by the host before joining the video session. I couldn’t find information in the documentation on setting up a waiting room. Below are the steps I used to create the video session.
thanks!
Create JWT token on the API side
const iat = Math.round(new Date().getTime() / 1000) - 30
const exp = iat + 60 * 60 * 2
const oHeader = { alg: 'HS256', typ: 'JWT' }
let role = ZOOM_ROLE.PARTICIPANT
let identity = 'Participant'
if (this.isModerator(context)) {
role = ZOOM_ROLE.HOST
}
if (context.userID) {
identity = `${context.firstName} ${context.lastName}`;
}
const oPayload = {
app_key: this.zoomSDKKey,
tpc: roomID,
role_type: role,
user_identity: identity,
version: 1,
iat: iat,
exp: exp
}
this.logger.log(`Zoom Token Content ${redact(oPayload)}`);
const jwt = jsonwebtoken.sign(oPayload, this.zoomSDKSecret, {
algorithm: 'HS256',
header: oHeader,
});
Join the session on the client side
this.client = ZoomVideoSDK.createClient()
this.client.init('en-US', 'CDN');
const config = {
videoSDKJWT: videoSession.token,
sessionName: videoSession.roomID,
userName: videoSession.userID,
features: ['video', 'audio', 'share', 'users', 'settings']
}
const sessionContainer: HTMLElement | null = document.querySelector(htmlElementID)
console.log('[video-session] config', config, sessionContainer)
if (sessionContainer) {
console.log('uitoolkit start')
uitoolkit.joinSession(sessionContainer, config)
}