Description
I’m trying to integrate zoom video in react web app.
Using react-hooks feature here.
For getting signature -
- created a free zoom developer account
- created a JWT app to get the api_key and api_secret
- deploy the signature sample app to a free Heroku instance
Error
I am getting error - The meeting number is wrong . while launching the zoom meeting
Which version?
“react”: “^16.13.1”,
“@zoomus/websdk”: “^1.7.9”,
Screenshots
System Info:
- Device: Lenovo-L450
- OS: Ubuntu 16.04
- Browser:Chrome
Zoom component code:
import React, { useEffect, useState } from ‘react’;
import { Grid, Card } from ‘@material-ui/core’;
import { ZoomMtg } from ‘@zoomus/websdk’;
import ‘@zoomus/websdk/dist/css/bootstrap.css’;
import ‘@zoomus/websdk/dist/css/react-select.css’;
const meetConfig = {
apiKey: API_KEY,
apiSecret: API_SECRET,
meetingNumber: ‘meeting-id’,
userEmail: ‘some-email-id’,
userName: ‘some-username’,
passWord: ‘some-password’,
leaveUrl: ‘http://localhost:3000’,
role: 0,
};
const ZoomComponent = () => {
const [meetingLaunched, setMeetingLaunched] = useState(false);
const joinZoomMeeting = () => {
setMeetingLaunched(!meetingLaunched);
fetch(‘https://zoom-signature-app.herokuapp.com/’, {
method: ‘POST’,
body: JSON.stringify({ meetingData: meetConfig }),
})
.then((result) => result.text())
.then(
(response) => {
ZoomMtg.init({
leaveUrl: meetConfig.leaveUrl,
isSupportAV: true,
success() {
ZoomMtg.join(
{
meetingNumber: meetConfig.meetingNumber,
userName: meetConfig.userName,
signature: JSON.parse(response).signature,
apiKey: meetConfig.apiKey,
userEmail: meetConfig.userEmail,
passWord: meetConfig.passWord,
success() {
console.log(‘join meeting success’);
},
error(res1) {
console.log(res1);
},
},
);
},
error(res2) {
console.log(res2);
},
});
},
);
};
useEffect(() => {
ZoomMtg.setZoomJSLib(‘node_modules/@zoomus/websdk/dist/lib’, ‘/av’);
ZoomMtg.preLoadWasm();
ZoomMtg.prepareJssdk();
joinZoomMeeting();
}, );
return (
);
};
export default ZoomComponent;