Unable to init meeting

@tommy yes, I set breakpoints and can confirm init() is being called.

I tried unminifying as much of the Zoom SDK as I could and even stepped into its init() function. It’s definitely being called but it’s still hard to make sense of it since the source is pretty blackboxed.

Hey @jvall,

I wonder if the promise chain is messing things up. Can you implement the Init and Join functions similar to the Sample App?

ZoomMtg.init({
  debug: true,
  leaveUrl: 'http://localhost:3000/post-meeting-page',
  isSupportAV: true,
  success() {
    ZoomMtg.join({
      meetingNumber: xxxxxxxxxx,
      userName: 'John',
      signature,
      apiKey: zoomSdkLaunchKey(),
      userEmail: 'john@example.com',
      success() {
        resolve();
      },
      error(res) {
        reject(res);
      }
    });
  },
  error(res) {
    reject(res);
  }
});

Thanks,
Tommy

Still the same result. I copy-and-pasted the nested-style code from the sample app and init still doesn’t hit the breakpoints on success or error.

Hey @jvall,

Try adding these following lines after importing ZoomMtg:

ZoomMtg.preLoadWasm();
ZoomMtg.prepareJssdk();

And here is the a sample react Web SDK app:

Thanks,
Tommy

Hi, jvall. Did you find any resolution to this? I’m experiencing the same issue in a React app I’m working on. Hope your help

Hey @qiumeihui,

Please provide more details about your issue.

Make sure to include the following lines:

ZoomMtg.preLoadWasm();
ZoomMtg.prepareJssdk();

Thanks,
Tommy

What ended up solving it was calling those two lines that Tommy posted and then including all of the required assets via the CDN

The information contained in this E-mail message and its attachments is privileged and/or confidential, and may be protected from disclosure. Please be aware that any other use, printing, copying, disclosure or dissemination of this communication may be subject
to legal restriction or sanction.

Hey @jvall,

Glad using the CDN solved the issue! :slight_smile:

Thanks,
Tommy

Hey @tommy.
I’m sure use the following lines:

ZoomMtg.preLoadWasm();
ZoomMtg.prepareJssdk();
ZoomMtg.setZoomJSLib('https://jssdk.zoomus.cn/1.7.0/lib', '/av');

But When the function ZoomMtg.init() executes, it directly jumps out and there are no errors here. I want to know what causes the init function to jump out.

Thanks,
Qiumeihui

Hey @qiumeihui,

Are there any errors in the browser console?

Can you try having the setZoomJSLib function first?

ZoomMtg.setZoomJSLib('https://jssdk.zoomus.cn/1.7.0/lib', '/av');
ZoomMtg.preLoadWasm();
ZoomMtg.prepareJssdk();

Thanks,
Tommy

@tommy Hey tommy.
I find a strange phenomenon here.
I used Web SDK in React.

  openLive() {
        ZoomMtg.setZoomJSLib('https://jssdk.zoomus.cn/1.7.0/lib', '/av');
        ZoomMtg.preLoadWasm();
        ZoomMtg.prepareJssdk();
        //  chinese
        $.i18n.reload('zh-CN');

        const meetConfigs = {
            apiKey: API_KEY,
            apiSecret: API_SECRET,
            meetingNumber:,
            role: 0, // 0 to join the meeting,  1 to start the meeting
            leaveUrl: '', 
            userName: 'test WebSDK', 
        };

        const signature = ZoomMtg.generateSignature({
            meetingNumber: meetConfigs.meetingNumber,
            apiKey: meetConfigs.apiKey,
            apiSecret: meetConfigs.apiSecret,
            role: meetConfigs.role,
            success(res) {
                console.log(res.result);
            },
        });

        ZoomMtg.init({
            debug: true, // optional
            leaveUrl: '', // required
            isSupportAV: true, // optional,
            success: () => {
                console.log('init success!!!!');
                ZoomMtg.join({
                    signature,
                    meetingNumber: meetConfigs.meetingNumber,
                    userName: meetConfigs.userName,
                    userEmail: '',
                    passWord: '',
                    apiKey: meetConfigs.apiKey,
                    success(res) {
                        console.log(res);
                    },
                    error: error => {
                        console.log(error);
                    },
                });
            },
            error: error => {
                console.log(error);
            },
        });
    }

When I use the code in the componentDidMount method of some components, the init method can execute normally and successfully join the meeting, but when used in the componentDidMount method of some components, the init method will directly jump It has been executed and no errors are printed. I want to know if this good and bad phenomenon is related to the execution time node of componentDidMount and the loading order of the dependency js library of the Web SDK

Hey @qiumeihui,

Did you mean to say a different method? What is the difference between the two scenarios?

Thanks,
Tommy

Hey @tommy.
In React, I used the Zoomtg.init method in componentDidmount of different components, but some of them succeeded and some failed. I don’t know if this is related to the order of the React life cycle mount.

Thanks,
Qiumeihui

Hey @qiumeihui,

I am guessing this is due to the Zoommtg.init being called before the resources load.

Maybe add a few second timeout to see if that fixes the issue.

Thanks,
Tommy

Hey @tommy .
I put the Zoomtg.init method in setTimeout, it working now.
Thank you very much for your suggestions. :grin:

Thanks,
Qiumeihui

2 Likes

Glad that worked! :slight_smile:

Happy to help!

Thanks,
Tommy

1 Like

Is there any better way to fix this?

Thanks

Hi @saurabh,

We are working to fix this bug but right now the workaround would be to use the setTimeout method.

Thanks

I am facing an issue where when I use useEffect to join the meeting then, I am getting an error which i am consoling it in the terminal from the response coming in success attribute of init and join methods and the error is - “{method: “init”, status: false, errorCode: 3008, errorMessage: “Please init meeting first!”, result: null}”. This is coming in the success method of join method.
But the ZoomMtg.init function response is - “{method: “init”, status: true, errorCode: 0, errorMessage: null, result: null}”.
This error is not coming when I am not using useEffect to call the function.

const Meeting = (props) => {
    const getMeetingConfig = () => ({
        meetingNumber: parseInt(props.params.mn),
        apiKey: API_KEY,
        apiSecret: API_SECRET,
        role: 1,
        userName: 'Vk',
        passWord: props.params.pass,
        leaveUrl: '/zoom-poc',
        userEmail: ''
    })

    const createSignature = () => {    
        const meetingConfig = getMeetingConfig();
        ZoomMtg.generateSignature({
            meetingNumber: meetingConfig.meetingNumber,
            apiKey: meetingConfig.apiKey,
            apiSecret: meetingConfig.apiSecret,
            role: meetingConfig.role,
            success: (res) => {
                beginJoin(res.result)
            },
        });
    }

    const beginJoin = (signature) => {
        const meetingConfig = getMeetingConfig();

        ZoomMtg.init({
            leaveUrl: meetingConfig.leaveUrl,
            isSupportAV: true,
            success: (success) => {
                console.log(success)
                ZoomMtg.join({
                    meetingNumber: meetingConfig.meetingNumber,
                    userName: meetingConfig.userName,
                    signature,
                    apiKey: meetingConfig.apiKey,
                    userEmail: meetingConfig.userEmail,
                    passWord: meetingConfig.passWord,
                    success: (res) => {
                        console.log("join meeting success");
                    },
                    error: (res) => {
                        console.log(res);
                    },
                });
            },
            error: (res) => {
                console.log(res);
            },
        });
    }, 2000)
    };

    useEffect(() => {
        ZoomMtg.setZoomJSLib('https://source.zoom.us/1.8.5/lib', '/av');
        ZoomMtg.preLoadWasm();
        ZoomMtg.prepareJssdk();
        createSignature()
    }, [])

    return (
        <div id='zmmtg-root' />
    )
}

export default Meeting;

Hey @vk-jangid,

Thank you for reaching out to the Zoom Developer Forum. Please try moving the following lines to the top of the file so that we can ensure they are always set before any other code runs and the scope they reside in is available for all functions on the page.

        ZoomMtg.setZoomJSLib('https://source.zoom.us/1.8.5/lib', '/av');
        ZoomMtg.preLoadWasm();
        ZoomMtg.prepareJssdk();

If you’re looking for more detail on how this can be configured, please see our Sample Web App.

I hope that helps! Let me know if you have any questions.

Thanks,
Max