Description
I’m trying to create a component view of zoom meeting but i’m getting an error. Can someone help me? Thanks
Browser Console Error
{type: ‘JOIN_MEETING_FAILED’, reason: ‘No permission.’, errorCode: 3713}
Which Web Meeting SDK version?
Knowing the version can help us to identify your issue faster. [e.g. 1.9.9]
Meeting SDK Code Snippets
import React, { useEffect, useState } from “react”;
import ZoomMtgEmbedded from ‘@zoomus/websdk/embedded’;
import KJUR from “jsrsasign”;
const SampleZoom = () => {
const [signature, setSignature] = useState(’’);
const client = ZoomMtgEmbedded.createClient();
const generateSignature = (sdkKey, sdkSecret, meetingNumber, role) => {
const iat = Math.round((new Date().getTime() - 30000) / 1000)
const exp = iat + 60 * 60 * 2
const oHeader = { alg: ‘HS256’, typ: ‘JWT’ }
const oPayload = {
sdkKey: sdkKey,
mn: meetingNumber,
role: role,
iat: iat,
exp: exp,
appKey: sdkKey,
tokenExp: iat + 60 * 60 * 2
}
const sHeader = JSON.stringify(oHeader)
const sPayload = JSON.stringify(oPayload)
const signature = KJUR.jws.JWS.sign('HS256', sHeader, sPayload, sdkSecret)
setSignature(signature);
};
const initMeeting = () => {
client.init({
debug: true,
zoomAppRoot: meetingSDKElement,
language: ‘en-US’,
customize: {
meetingInfo: [
‘topic’,
‘host’,
‘mn’,
‘pwd’,
‘telPwd’,
‘invite’,
‘participant’,
‘dc’,
‘enctype’,
],
toolbar: {
buttons: [
{
text: ‘Custom Button’,
className: ‘CustomButton’,
onClick: () => {
console.log(‘custom button’);
},
},
],
},
},
});
};
const joinMeeting = () => {
client.join({
apiKey: process.env.REACT_APP_ZOOM_SDK_KEY,
signature: signature, // role in signature needs to be 1
meetingNumber: 81378006510,
password: 292176,
userName: “test”
})
};
useEffect(() => {
generateSignature(process.env.REACT_APP_ZOOM_SDK_KEY, process.env.REACT_APP_ZOOM_SDK_SECRET, 81378006510, 1)
if (signature) {
initMeeting();
}
}, [signature]);
let meetingSDKElement = document.getElementById(‘meetingSDKElement’);
return (
JOIN MEETING
)
};
export default SampleZoom;
Device (please complete the following information):
- Chrome