0

This is my Zoommsdk.js file am trying to integrate the Zoom Web SDK onto my React App, I went through their documentation and followed the steps of their Sample App(server.to.server app), but however - When I try to join A meeting from my App, It is stuck on Joining Meeting. as you can see from the image below. My code is as follows

import React, {useEffect} from "react";

declare var ZoomMtg;

ZoomMtg.setZoomJSLib("https://source.zoom.us/2.6.0/lib", "/av");

ZoomMtg.preLoadWasm();
ZoomMtg.prepareWebSDK();

ZoomMtg.i18n.load('en-US');
ZoomMtg.i18n.reload('en-US');
function ZoomMSDK() {
// Get Zoom MSDK KEY, Signature endpoint, and leave URL environment variables
const {
  REACT_APP_ZOOM_MSDK_KEY = "",
  REACT_APP_MSDK_SIGNATURE_ENDPOINT = "",
  LEAVE_URL = "http://localhost:3000",
 } = process.env;

 // Get the meeting number and password from the URL parameters
 const queryParams = new URLSearchParams(window.location.search);
 const mn = queryParams.get("mn");
 const pw = queryParams.get("pw");

// Assign meeting role based on user type
const role = "1"; // 1 for host, 0 for attendee


  const getSignature = (e) => {

    if (e) e.preventDefault();
   
    const SIGNATURE_OPTIONS = {
      method: "POST",
      headers: { "Content-Type": "application/json"},
      body: JSON.stringify({
        meetingNumber: mn,
        role:  parseInt(role, 10),
      }),
    };

    fetch(REACT_APP_MSDK_SIGNATURE_ENDPOINT, SIGNATURE_OPTIONS)
      .then((data) => data.json())
      .then(({ signature }) => !!signature && startMeeting(signature));
  };

const startMeeting = (signature) => {
  document.getElementById("zmmtg-root").style.display = "block";

  ZoomMtg.init({
      leaveUrl: LEAVE_URL,
    
      success: (success) => {
        console.log(success)

        ZoomMtg.join({
          signature: signature,
          meetingNumber: mn,
          sdkKey: REACT_APP_ZOOM_MSDK_KEY,
          userName: "firas ghobber",
          passWord: pw,
       //   tk:'',
          success: (success) => {
            console.log(success)
          },
          error: (error) => {
            console.log(error)
          }
        })
      },
      error: (error) => {
        console.log(error)
      }
    })
  }

This is console log error

i want to solve this problem for my project i m waiting your response.

Rohit Gupta
  • 4,022
  • 20
  • 31
  • 41
firas
  • 1
  • 1

0 Answers0