Zoom web sdk integration is not working

Description
I am trying to integrate zoom web sdk in my reactjs based project. I have added dependency in package.json of websdk version 1.7.5.
"@zoomus/websdk": "^1.7.5",

I am not sure what this means

NOTE: The following files (already in node_modules) must be globally accessible (equivalent of link and script tag in index.html):

  • node_modules/@zoomus/websdk/dist/css/bootstrap.css
  • node_modules/@zoomus/websdk/dist/css/react-select.css
  • node_modules/jquery/dist/jquery.min.js

How to achieve this in my frontend project, though all my node modules are globally accesible. Do I need to do anything for above.


Below is the code that I am using to join meeting

      import React, { Component } from 'react';
    import { Card } from 'my-modules/atoms';
    import { Input } from 'my-modules/atoms';
    import { Button } from 'my-modules/atoms';
    import { ZoomMtg } from '@zoomus/websdk';

    class ZoomCall extends Component {
      constructor(props) {
        super(props);
        this.state = {
          isFullTime: false
        };
      }

      componentDidMount() {
        setTimeout(() => {
          ZoomMtg.setZoomJSLib('node_modules/@zoomus/websdk/dist/lib/', '/av');
          ZoomMtg.preLoadWasm();
          ZoomMtg.prepareJssdk();
        }, 6000);
      }

      joinZoomMeeting = () => {
        console.log('checkSystemRequirements');
        console.log(JSON.stringify(ZoomMtg.checkSystemRequirements()));
        const meetConfig = {
          apiKey: API_KEY,
          apiSecret: SECRET_KEY,
          meetingNumber: meetingId,
          userName: 'Name',
          passWord: 123,
          leaveUrl: 'http://localhost:9009',
          role: 1
        };
        ZoomMtg.generateSignature({
          meetingNumber: meetConfig.meetingNumber,
          apiKey: meetConfig.apiKey,
          apiSecret: meetConfig.apiSecret,
          role: meetConfig.role,
          success(res) {
            console.log('signature', res.result);
            ZoomMtg.init({
              leaveUrl: meetConfig.leaveUrl,
              success() {
                ZoomMtg.join(
                  {
                    meetingNumber: meetConfig.meetingNumber,
                    userName: meetConfig.userName,
                    signature: res.result,
                    apiKey: meetConfig.apiKey,
                    passWord: meetConfig.passWord,
                    success() {
                      console.log('join meeting success');
                    },
                    error(respo) {
                      console.log(respo);
                    }
                  }
                );
              },
              error(response) {
                console.log(response);
              }
            });
          }
        });
      };

      render() {
        console.log('Zoom meeting');
        console.log(this.state.isFullTime);
        return (
          <Card>
            <Input placeholder="enter comment here..." />
            <Button
              style={{ width: '150px', margin: '10px' }}
              onClick={this.joinZoomMeeting}
            >
              Submit
            </Button>
          </Card>
        );
      }
    }
export default ZoomCall;

Error
Not able to see any error in console.

Which version?
websdk - 1.7.5.

Screenshots

Smartphone (please complete the following information):

  • Browser:Chrome

Additional context
I first ran sample app which working fine, but its not working when I am integrating with my project. Page is not loading properly when I have added zoom join call code. If I remove joinZoomMeeting method and all code related to zoom, then its working fine.

Initially i was getting error, when I was calling preLoadWasm and prepareJssdk methods outside the ZoomCall class -

import React, { Component } from 'react';
import { Card } from 'dashboard-modules/atoms';
import { Input } from 'dashboard-modules/atoms';
import { Button } from 'dashboard-modules/atoms';
import { ZoomMtg } from '@zoomus/websdk';

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

class ZoomCall extends Component {
  constructor(props) {
super(props);
this.state = {
  isFullTime: false
};
  }
  
  joinZoomMeeting = () => {
console.log('checkSystemRequirements');
console.log(JSON.stringify(ZoomMtg.checkSystemRequirements()));
const meetConfig = {
  apiKey: API_KEY,
  apiSecret: SECRET_KEY,
  meetingNumber: MeetingId,
  userName: 'Name',
  passWord: 123,
  leaveUrl: 'http://localhost:9009',
  role: 1
};
ZoomMtg.generateSignature({
  meetingNumber: meetConfig.meetingNumber,
  apiKey: meetConfig.apiKey,
  apiSecret: meetConfig.apiSecret,
  role: meetConfig.role,
  success(res) {
    console.log('signature', res.result);
    ZoomMtg.init({
      leaveUrl: meetConfig.leaveUrl,
      success() {
        ZoomMtg.join(
          {
            meetingNumber: meetConfig.meetingNumber,
            userName: meetConfig.userName,
            signature: res.result,
            apiKey: meetConfig.apiKey,
            passWord: meetConfig.passWord,
            success() {
              console.log('join meeting success');
            },
            error(respo) {
              console.log(respo);
            }
          }
        );
      },
      error(response) {
        console.log(response);
      }
    });
  }
});
  };

  render() {
console.log('Zoom meeting');
console.log(this.state.isFullTime);
return (
  <Card>
    <Input placeholder="enter comment here..." />
    <Button
      style={{ width: '150px', margin: '10px' }}
      onClick={this.joinZoomMeeting}
    >
      Submit
    </Button>
  </Card>
);
  }
}

export default ZoomCall;

So I got this error:

Cannot update during an existing state transition (such as within render or another component’s constructor). Render methods should be a pure function of props and state; constructor side-effects are an anti-pattern, but can be moved to componentWillMount

so I added componentWillMount, set some timeout there and added call to preLoadWasm and prepareJssdk methods from componentWillMount. After that above error gone.

Like in below code snippet:

import React, { Component } from 'react';
import { Card } from 'dashboard-modules/atoms';
import { Input } from 'dashboard-modules/atoms';
import { Button } from 'dashboard-modules/atoms';
import { ZoomMtg } from '@zoomus/websdk';

ZoomMtg.setZoomJSLib('node_modules/@zoomus/websdk/dist/lib/', '/av');

class ZoomCall extends Component {
  constructor(props) {
    super(props);
    this.state = {
      isFullTime: false
    };
  }

  componentWillMount() {
    setTimeout(() => {
      ZoomMtg.preLoadWasm();
      ZoomMtg.prepareJssdk();
    }, 6000);
  }

  joinZoomMeeting = () => {
    console.log('checkSystemRequirements');
    console.log(JSON.stringify(ZoomMtg.checkSystemRequirements()));
    const meetConfig = {
        apiKey: API_KEY,
       apiSecret: SECRET_KEY,
       meetingNumber: MeetingId,
       userName: 'Name',
      passWord: 123,
      leaveUrl: 'http://localhost:9009',
      role: 1
    };
    ZoomMtg.generateSignature({
      meetingNumber: meetConfig.meetingNumber,
      apiKey: meetConfig.apiKey,
      apiSecret: meetConfig.apiSecret,
      role: meetConfig.role,
      success(res) {
        console.log('signature', res.result);
        ZoomMtg.init({
          leaveUrl: meetConfig.leaveUrl,
          success() {
            ZoomMtg.join(
              {
                meetingNumber: meetConfig.meetingNumber,
                userName: meetConfig.userName,
                signature: res.result,
                apiKey: meetConfig.apiKey,
                passWord: meetConfig.passWord,
                success() {
                  console.log('join meeting success');
                },
                error(respo) {
                  console.log(respo);
                }
              }
            );
          },
          error(response) {
            console.log(response);
          }
        });
      }
    });
  };

  render() {
    console.log('Zoom meeting');
    console.log(this.state.isFullTime);
    return (
      <Card>
        <Input placeholder="enter comment here..." />
        <Button
          style={{ width: '150px', margin: '10px' }}
          onClick={this.joinZoomMeeting}
        >
          Submit
        </Button>
      </Card>
    );
  }
}

export default ZoomCall;

But now new error started coming, I was calling setZoomJSLib just after the import of ZoomMtg, now below undefined error started coming:

Cannot read property ‘setZoomJSLib’ of undefined

So I moved ZoomMtg.setZoomJSLib call into componentWillMount. Now no error is coming and page is not loading.

I am suspecting there is some error in configuration of zoom, as after removing zoom code part page loads properly. Probably css are from node_module/@zoomus/websdk/dist/css or something is wrong.

After reading through various posts on this forum I found that I need to add bootstrap.css, react-select.css and jquery.min.js into my index.html

<!DOCTYPE html>
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=0" />
  <link type="text/css" rel="stylesheet" href="https://source.zoom.us/1.7.5/css/bootstrap.css" />
  <link type="text/css" rel="stylesheet" href="https://source.zoom.us/1.7.5/css/react-select.css" />
</head>
<body>
<div id='root'></div>
<script src="https://source.zoom.us/1.7.5/lib/vendor/jquery.min.js"></script>
</body>

After adding above files in index.html page final starts loading but screen is now all black

Additional changes:

Also loading the JSLib. from https://source.zoom.us/1.7.5/lib
Final code after these changes

import React, { Component } from 'react';
import './ZoomButton.css';
import { ZoomMtg } from '@zoomus/websdk';
import { Button, Card } from 'dashboard-modules/atoms';

// Add this, never use it client side in production
const API_KEY = 'API_KEY';
const API_SECRET = 'API_SECRET';
// This can be your Personal Meeting ID
const MEETING_NUMBER = 122324;

const meetConfig = {
  apiKey: API_KEY,
  apiSecret: API_SECRET,
  meetingNumber: MEETING_NUMBER,
  userName: 'test user',
  passWord: '',
  leaveUrl: 'https://zoom.us',
  role: 1
};

export default class Zoom extends Component {
  state = {
    meetingLaunched: false
  };

  componentDidMount() {
    ZoomMtg.setZoomJSLib('https://source.zoom.us/1.7.5/lib', '/av');
    ZoomMtg.preLoadWasm();
    ZoomMtg.prepareJssdk();
  }

  launchMeeting = () => {
    console.log('Launching meeting');
    // change state of meeting
    this.setState({ meetingLaunched: !this.state.meetingLaunched });

    // generateSignature should only be used in development
    ZoomMtg.generateSignature({
      meetingNumber: meetConfig.meetingNumber,
      apiKey: meetConfig.apiKey,
      apiSecret: meetConfig.apiSecret,
      role: meetConfig.role,
      success(res) {
        console.log('signature', res.result);
        ZoomMtg.init({
          leaveUrl: 'http://www.zoom.us',
          success() {
            ZoomMtg.join(
              {
                meetingNumber: meetConfig.meetingNumber,
                userName: meetConfig.userName,
                signature: res.result,
                apiKey: meetConfig.apiKey,
                userEmail: 'email@gmail.com',
                passWord: meetConfig.passWord,
                success() {
                  console.log('join meeting success');
                },
                error(res2) {
                  console.log(res2);
                }
              }
            );
          },
          error(res3) {
            console.log(res3);
          }
        });
      }
    });
  };


  render() {
    console.log('Your page rendering starts now!');
    console.log(ZoomMtg.checkSystemRequirements());
    const { meetingLaunched } = this.state;
    return (
      <Card>
        {!meetingLaunched ?
          <Button type="primary" className="launchButton">Launch Meeting</Button>
          : <Button> No Meeting</Button>
        }
      </Card>
    );
  }
}

Any suggestions will be much appreciated.

Hey @taushifali,

Make sure to include the preload functions mentioned here:

Are you seeing any errors in the browser console?

Can you add logs to the two success functions and share what is being logged?

ZoomMtg.init({
          leaveUrl: 'http://www.zoom.us',
          success(res) {
             console.log(res)

Thanks,
Tommy

Hey @tommy,
Thanks for responding.

I have followed the following project.

After adding lib from CDN like this ZoomMtg.setZoomJSLib(“https://source.zoom.us/1.7.5/lib”, “/av”) + loading bootstrap.css and react-select.css from cdn too. This started working.

Earliar ZoomMtg was not loading and getting undefined value for it.

I have managed to solve the UI issue after manipulating #zmmtg-root a bit too, after following this post:

Now I am stuck with different issue as explained below:
Two different hosts cannot join two parallel meetings using the same API Key and API Secret.

  1. Is this expected behaviour? Do I need to create separate API Key and API Secret for all the users who want to join meeting from web sdk?

  2. Is there any possible good alternate solution to join different meetings by different people, using same API Key and API Secret?

Thanks
Taushif

Hey @michael.zoom,

Please help with this. They are following your sample app. :slight_smile:

Thanks,
Tommy

@taushifali @tommy

For future reference, I don’t believe this issue is related to the sample app used.

Todd, can you provide us any info on the errors you’re receiving? This is not expected behavior (or true); an API Key/Secret is used by the owner of the Web SDK app. With appropriate Meeting IDs, email / username fields when joining, and user access (like passwords), the Web SDK methods can be used to join any number of users into a meeting.

Thanks @michael.harrington for your response over this.

Let me clarify more on this issue.
I am trying to use same API key and API secret to host/join two parallel meetings. But I am not able to join two parallel meetings(different meeting Ids), where API Key and API Secret are same.

Error: Your connection has timed out and you cannot join the meeting. Verify your network connectivity and try again.

How can I achieve this, is there anyway that I don’t need to generate API Key and API Secret for all the users.

Hey @taushifali,

This should be possible when using role 0.

Can you share your signature to developersupport@zoom.us so I can debug further?

Thanks,
Tommy

Hey @tommy,
Thanks for replying.

I am looking this for role 1.

If it is not possible to join as host, with same API key and API secret, in two or more parallel meetings.
Is there any automated way, like some zoom API’s, to generate API key and API secret for all my users?
Or I have to create API key and API secret from zoom market place?

Hey @taushifali,

You should be able to start multiple different meetings that you own using the Web SDK.

Are you generating a new seperate signature for each one?

Thanks,
Tommy

Hey @tommy,
As signature is dependent on time and meetingId. Hence yes, I am generating different signatures for different meetings.

const generateSignature = (credentials, meetingNumber, role) => {
  const timestamp = new Date().getTime() - 30000;
  const msg = Buffer.from(credentials.apiKey + meetingNumber + timestamp + role).toString('base64');
  const hash = Crypto.createHmac('sha256', credentials.apiSecret).update(msg).digest('base64');
  return Buffer.from(`${credentials.apiKey}.${meetingNumber}.${timestamp}.${role}.${hash}`).toString('base64');
};

And I am not able to join two meetings in parallel as host.

Can you please elaborate on what you mean by:

start multiple different meetings that you own using the Web SDK.

As I am able to start multiple meetings with same Web SDK, but not able to start two meetings in parallel as host.

Thanks
Taushif

Hey @taushifali,

To clarify, my question is, are the multiple meetings being created for the same user (host)?

It should work if each meeting is created for a seperate user, see my teammates post here:

For example it should work in this scenario:

Meeting A created by user A on your account.

Meeting B created by user B on your account.

Not, Meeting A and B created by user A.

Thanks,
Tommy

Hello, Im solving same problem as you did in the past and I cant move from that “black screen” as you described. I followed all your steps but I still cant move from that place. It seems that I have problem with some ZoomMtg settings because in console I see “Before mounting” and “After mounting” but also only blackscreen in browser. Can you please describe to me, how you solved it? Thank you for answer. Here are all my files connected to Stream React component. I tried also variants without css styling component and with CDN imports in index.html, but still not working.
Stream.tsx

import { Component } from “react”;
import React from “react”;
import {ZoomMtg} from ‘@zoomus/websdk’;
const zoomMeeting = document.getElementById(“zmmtg-root”)
const meetConfig = {
apiKey: MY_JWT_API_KEY,
apiSecret: MY_JWT_API_SECRET,
meetingNumber: MY_PERSONAL_ID_NUMBER,
leaveUrl: ‘https://zoom.us’,
userName: USER_NAME,
passWord: ‘’, // if required
role: 1 // 1 for host; 0 for attendee or webinar
};

export class Stream extends Component<{},{meetingLaunched: boolean}> {

constructor(props) {
    super(props);
    this.state = { meetingLaunched : false}
}

joinZoomMeeting = () => {
console.log(‘checkSystemRequirements’);
console.log(JSON.stringify(ZoomMtg.checkSystemRequirements()));
ZoomMtg.generateSignature({
meetingNumber: meetConfig.meetingNumber,
apiKey: meetConfig.apiKey,
apiSecret: meetConfig.apiSecret,
role: meetConfig.role,
success(res) {
console.log(‘signature’, res.result);
ZoomMtg.init({
leaveUrl: meetConfig.leaveUrl,
success() {
ZoomMtg.join(
{
meetingNumber: meetConfig.meetingNumber,
userName: meetConfig.userName,
signature: res.result,
apiKey: meetConfig.apiKey,
passWord: meetConfig.passWord,
success() {
console.log(‘join meeting success’);
},
error(respo) {
console.log(respo);
}
}
);
},
error(response) {
console.log(response);
}
});
}
});
};

render() {
return (


{this.state.meetingLaunched ?
Launch Meeting
:
<></>
}

)
}

componentDidMount() {
console.log(“Before mounting.”)
setTimeout(() => {
ZoomMtg.setZoomJSLib(“https://source.zoom.us/1.7.7/lib”, “/av”);
ZoomMtg.preLoadWasm();
ZoomMtg.prepareJssdk();
}, 6000);
console.log(“After mounting.”)
}

}
index.html

App.css

#zmmtg-root {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  background-color: black;

}

Hey @hrondor,
What are you getting for checkSystemRequirements in console?
Is your ZoomMtg loading fine?

Did you managed properly the zmmtg-root display properties as from the post Zoom Meeting Custom Ui.

What are you seeing in DOM’s network tab for the bootstrap.css and react-select.css?

I am pasting my current code, let me know if you get it worked with this.

import React, { Component } from 'react';
import { ZoomMtg } from '@zoomus/websdk';
import connect from 'src/apiClient';
import PropTypes from 'prop-types';
import { PromiseState } from 'react-refetch';
import PromiseStateContainer from '../../PromiseStateContainer';
import { createVideoConference } from '../../../services/videoConferencing.service';
import { selfUrl } from 'src/config';

const zoomMeeting = document.getElementById('zmmtg-root');

class ZoomConference extends Component {
  static propTypes = {
    match: PropTypes.object.isRequired,
    meetingDetails: PropTypes.instanceOf(PromiseState).isRequired
  };

  constructor(props) {
    super(props);
    this.state = {
      userEmail: 'myemail'
    };
  }

  componentDidMount() {
    ZoomMtg.setZoomJSLib('https://source.zoom.us/1.7.7/lib', '/av');
    ZoomMtg.preLoadWasm();
    ZoomMtg.prepareJssdk();
  }

  launchMeeting = () => {
    
    // change state of meeting
    this.setState({ meetingLaunched: !this.state.meetingLaunched })

    // generateSignature should only be used in development
    ZoomMtg.generateSignature({
        meetingNumber: meetConfig.meetingNumber,
        apiKey: meetConfig.apiKey,
        apiSecret: meetConfig.apiSecret,
        role: meetConfig.role,
        success(res) {
            console.log('signature', res.result);
            ZoomMtg.init({
                leaveUrl: 'http://www.zoom.us',
                success() {
                    ZoomMtg.join(
                        {
                            meetingNumber: meetConfig.meetingNumber,
                            userName: meetConfig.userName,
                            signature: res.result,
                            apiKey: meetConfig.apiKey,
                            userEmail: 'email@gmail.com',
                            passWord: meetConfig.passWord,
                            success() {
                                console.log('join meeting success');
                            },
                            error(res) {
                                console.log(res);
                            }
                        }
                    );
                },
                error(res) {
                    console.log(res);
                }
            });
        }
    });
}


  render() {
    zoomMeeting.style.display = 'none';
    zoomMeeting.style.height = '0px';
    zoomMeeting.style.width = '0px';
    zoomMeeting.style.position = 'relative';
    zoomMeeting.style.backgroundColor = 'black';
    zoomMeeting.style.zIndex = '1';
    return (
      <span>{this.launchMeeting()}</span>
    );
  }
}

Index.html

<!DOCTYPE html>
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=0" />
  <link type="text/css" rel="stylesheet" href="https://source.zoom.us/1.7.7/css/bootstrap.css" />
  <link type="text/css" rel="stylesheet" href="https://source.zoom.us/1.7.7/css/react-select.css" />
</head>
<body>
<div id='root'></div>
<script src="https://source.zoom.us/1.7.7/lib/vendor/jquery.min.js"></script>
</body>
2 Likes

Thank you very much for help and fast answer!:slight_smile: So I advanced, when I give render and ZoomMeeting this parameters, I see 100x200px blue window in left of my page(empty without call). When I click to button Im redirected to full screen Zoom call, but when I put

<div id="zmmtg-root"></div>

instead of that button in render, I see again only black screen.

render() {
console.log(“Rendering.”)
if (zoomMeeting != null) {
zoomMeeting.style.height = ‘100px’;
zoomMeeting.style.width = ‘200px’;
zoomMeeting.style.position = ‘relative’;
zoomMeeting.style.backgroundColor = ‘blue’;
zoomMeeting.style.zIndex = ‘1’;
}
return (
<>
{!this.state.meetingLaunched ?

        <button className="launchButton" onClick={this.joinZoomMeeting}>Launch Meeting</button> 
    : 
    <></>
    }
</>
)
}

App.css

#zmmtg-root {
  width: 200px;
  height: 200px;
  position: relative;
}

Hey @hrondor,
You need to change the state this.state.meetingLaunched in joinZoomMeeting function, do this in first line => this.setState({ meetingLaunched: !this.state.meetingLaunched }).
As render function will be called again.

You need to turn off display of div “zmmtg-root” while rendering your page.

As div “zmmtg-root” is where zoom meeting UI loads.
You need to turn on again display of div “zmmtg-root” when you are joining zoom call.

For example you can call turnItOff in render method and turnItOn in joinZoomMeeting method.

 const turnItOn = () => {
    zoomMeeting.style.display = 'flex'
    zoomMeeting.style.height = '100%'
    zoomMeeting.style.width = '100%'
    zoomMeeting.style.position = 'fixed'
    zoomMeeting.style.zIndex = '1'
    zoomMeeting.style.backgroundColor = 'black'
  }

  const turnItOff = () => {
    zoomMeeting.style.display = 'none'
    zoomMeeting.style.height = '0px'
    zoomMeeting.style.width = '0px'
    zoomMeeting.style.position = 'relative'
    zoomMeeting.style.backgroundColor = 'black'
    zoomMeeting.style.zIndex = '1'
  }

It will be be more helpful if you add your whole file and attach screenshots in order to debug this.

1 Like

One more thank you for help!:slight_smile: If I run site with that Stream.tsx component, I can see button and normal white site, If I click to the button, which should invoke Zoom call, site is black with blue square in the left. And no call is invoked. I tried variant without switch, only with button component and no else method,call was started, but in full screen.
https://pastebin.com/pqba8G9s (App.tsx + Stream.tsx without meetConfig object only)
https://pastebin.com/ZNa7Mv0y(index.html + App.css) - I dont think its problem in App.css because all changes here seems without effect

Sorry I can attach only 2 links, so I had to connect 2 files in one paste bin:)

Hey @hrondor,
I think you are missing meeting configs, you need to generate API key and API secret as well as you need valid meeting Id and password to join meeting.

Check this out, it is working fine:-

import { Component } from 'react';
import React from 'react';
import { ZoomMtg } from '@zoomus/websdk';
import { Card } from 'dashboard-modules/atoms';

const zoomMeeting = document.getElementById('zmmtg-root');
const meetConfig = {
  apiKey: 'YOUR_API_KEY',
  apiSecret: 'YOUR_API_SECRET',
  meetingNumber: YOUR_MEETING_ID,
  leaveUrl: 'https://zoom.us',
  userName: 'USER_NAME',
  passWord: 'YOUR_PASSWORD', // if required
  role: 1 // 1 for host; 0 for attendee or webinar
};

class ZoomConference extends Component {
  constructor(props) {
    super(props);
    this.state = { meetingLaunched: false };
    this.turnItOff();
  }

  componentDidMount() {
    console.log('Before mounting.');
    setTimeout(() => {
      ZoomMtg.setZoomJSLib('https://source.zoom.us/1.7.7/lib', '/av');
      ZoomMtg.preLoadWasm();
      ZoomMtg.prepareJssdk();
    }, 6000);
    console.log('After mounting.');
  }

  turnItOn = () => {
    if (zoomMeeting != null) {
      zoomMeeting.style.display = 'flex';
      zoomMeeting.style.height = '100%';
      zoomMeeting.style.width = '100%';
      zoomMeeting.style.position = 'fixed';
      zoomMeeting.style.zIndex = '1';
      zoomMeeting.style.backgroundColor = 'blue';
    }
  }

  turnItOff = () => {
    if (zoomMeeting != null) {
      zoomMeeting.style.display = 'none';
      zoomMeeting.style.height = '0px';
      zoomMeeting.style.width = '0px';
      zoomMeeting.style.position = 'relative';
      zoomMeeting.style.backgroundColor = 'black';
      zoomMeeting.style.zIndex = '1';
    }
  };

  joinZoomMeeting = () => {
    this.setState({ meetingLaunched: !this.state.meetingLaunched });
    console.log('checkSystemRequirements');
    console.log(JSON.stringify(ZoomMtg.checkSystemRequirements()));
    ZoomMtg.generateSignature({
      meetingNumber: meetConfig.meetingNumber,
      apiKey: meetConfig.apiKey,
      apiSecret: meetConfig.apiSecret,
      role: meetConfig.role,
      success(res) {
        console.log('signature', res.result);
        ZoomMtg.init({
          leaveUrl: meetConfig.leaveUrl,
          success() {
            console.log('Sucess');
            ZoomMtg.join(
              {
                meetingNumber: meetConfig.meetingNumber,
                userName: meetConfig.userName,
                signature: res.result,
                apiKey: meetConfig.apiKey,
                passWord: meetConfig.passWord,
                success() {
                  console.log('join meeting success');
                },
                error(respo) {
                  console.log(respo);
                }
              }
            );
          },
          error(response) {
            console.log(response);
          }
        });
      }
    });
  };

  render() {
    if (!this.state.meetingLaunched) {
      this.turnItOff();
    } else {
      this.turnItOn();
    }
    console.log('Rendering.');
    if (zoomMeeting != null) {
      zoomMeeting.style.height = '500px';
      zoomMeeting.style.width = '200px';
      zoomMeeting.style.position = 'relative';
      zoomMeeting.style.zIndex = '1';
    }
    return (
      <Card>
        {!this.state.meetingLaunched ?

          <button className="launchButton" onClick={this.joinZoomMeeting}>Launch Meeting</button>
          :
          <div id="zmmtg-root" />
        }
      </Card>
    );
  }
}
export default ZoomConference;

To generate API key and API secret:

  1. Create zoom account, sign in your account if already have.
  2. Go to https://marketplace.zoom.us/, and click sign in on top right corner.
  3. Go to develop -> Build App
  4. Create JWT app.
  5. Add details and not down your API key and API secret.
1 Like

I only deleted my meetConfig details, because I didnt want to share API + API_SECRET but it shouldnt be problem with it, because as I wrote I was able to connect properly when I had only without switch to

.

Hey @hrondor,
I didn’t get the switch part, anyways seems it is working for you.