Skip to content

Commit 1bbe5ac

Browse files
committed
updated for 2.0.1 and added Component View example
1 parent 183e1fb commit 1bbe5ac

File tree

5 files changed

+106
-15
lines changed

5 files changed

+106
-15
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ To get started, clone the repo:
2222

2323
1. Open the `meetingsdk-sample-react` directory in your code editor.
2424

25-
1. Open the `src/app.js` file, and enter values for the variables:
25+
1. Open the `src/App.js` file, and enter values for the variables:
26+
27+
**NEW:** To use the [Component View](https://marketplace.zoom.us/docs/sdk/native-sdks/web/component-view), replace `App.js` with `App-New.js`. (The `leaveUrl` is not needed).
2628

2729
| Variable | Description |
2830
| -----------------------|-------------|
@@ -45,10 +47,10 @@ To get started, clone the repo:
4547
leaveUrl = 'http://localhost:3000'
4648
userName = 'React'
4749
userEmail = ''
48-
password = ''
50+
passWord = ''
4951
```
5052

51-
1. Save `app.js`.
53+
1. Save `App.js`.
5254

5355
1. Run the app:
5456

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "meetingsdk-sample-react",
3-
"version": "1.9.9",
3+
"version": "2.0.1",
44
"author": "Tommy Gaessler",
55
"homepage": "",
66
"private": true,

public/index.html

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,27 @@
2626
-->
2727
<title>Zoom Meeting SDK Sample React</title>
2828

29-
<link type="text/css" rel="stylesheet" href="https://source.zoom.us/1.9.9/css/bootstrap.css" />
30-
<link type="text/css" rel="stylesheet" href="https://source.zoom.us/1.9.9/css/react-select.css" />
29+
<link type="text/css" rel="stylesheet" href="https://source.zoom.us/2.0.1/css/bootstrap.css" />
30+
<link type="text/css" rel="stylesheet" href="https://source.zoom.us/2.0.1/css/react-select.css" />
3131

3232
<!-- Origin Trials to improve SDK performance on Chrome -->
3333
<!-- More Info: https://marketplace.zoom.us/docs/sdk/native-sdks/web/advanced/web-isolation -->
3434
<!-- SharedArrayBuffers in non-isolated pages on Desktop platforms -->
3535
<meta http-equiv="origin-trial" content="">
36-
<!-- WebAssembly SIMD -->
37-
<meta http-equiv="origin-trial" content="">
3836
</head>
3937
<body>
4038
<noscript>You need to enable JavaScript to run this app.</noscript>
4139
<div id="root"></div>
4240

43-
<script src="https://source.zoom.us/1.9.9/lib/vendor/react.min.js"></script>
44-
<script src="https://source.zoom.us/1.9.9/lib/vendor/react-dom.min.js"></script>
45-
<script src="https://source.zoom.us/1.9.9/lib/vendor/redux.min.js"></script>
46-
<script src="https://source.zoom.us/1.9.9/lib/vendor/redux-thunk.min.js"></script>
47-
<script src="https://source.zoom.us/1.9.9/lib/vendor/lodash.min.js"></script>
48-
<script src="https://source.zoom.us/zoom-meeting-1.9.9.min.js"></script>
41+
<script src="https://source.zoom.us/2.0.1/lib/vendor/react.min.js"></script>
42+
<script src="https://source.zoom.us/2.0.1/lib/vendor/react-dom.min.js"></script>
43+
<script src="https://source.zoom.us/2.0.1/lib/vendor/redux.min.js"></script>
44+
<script src="https://source.zoom.us/2.0.1/lib/vendor/redux-thunk.min.js"></script>
45+
<script src="https://source.zoom.us/2.0.1/lib/vendor/lodash.min.js"></script>
46+
<script src="https://source.zoom.us/zoom-meeting-2.0.1.min.js"></script>
47+
48+
<!-- For Component View -->
49+
<script src="https://source.zoom.us/2.0.1/zoom-meeting-embedded-2.0.1.min.js"></script>
4950

5051
<!--
5152
This HTML file is a template.

src/App-New.js

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
import React from 'react';
2+
3+
import './App.css';
4+
5+
declare var ZoomMtgEmbedded
6+
7+
function App() {
8+
9+
const client = ZoomMtgEmbedded.createClient();
10+
11+
// setup your signature endpoint here: https://github.com/zoom/meetingsdk-sample-signature-node.js
12+
var signatureEndpoint = ''
13+
var apiKey = ''
14+
var meetingNumber = '123456789'
15+
var role = 0
16+
var userName = 'React'
17+
var userEmail = ''
18+
var passWord = ''
19+
20+
function getSignature(e) {
21+
e.preventDefault();
22+
23+
fetch(signatureEndpoint, {
24+
method: 'POST',
25+
headers: { 'Content-Type': 'application/json' },
26+
body: JSON.stringify({
27+
meetingNumber: meetingNumber,
28+
role: role
29+
})
30+
}).then(res => res.json())
31+
.then(response => {
32+
startMeeting(response.signature)
33+
}).catch(error => {
34+
console.error(error)
35+
})
36+
}
37+
38+
function startMeeting(signature) {
39+
40+
let meetingSDKElement = document.getElementById('meetingSDKElement');
41+
42+
client.init({
43+
debug: true,
44+
zoomAppRoot: meetingSDKElement,
45+
language: 'en-US',
46+
customize: {
47+
meetingInfo: ['topic', 'host', 'mn', 'pwd', 'telPwd', 'invite', 'participant', 'dc', 'enctype'],
48+
toolbar: {
49+
buttons: [
50+
{
51+
text: 'Custom Button',
52+
className: 'CustomButton',
53+
onClick: () => {
54+
console.log('custom button');
55+
}
56+
}
57+
]
58+
}
59+
}
60+
});
61+
62+
client.join({
63+
apiKey: apiKey,
64+
signature: signature,
65+
meetingNumber: meetingNumber,
66+
password: passWord,
67+
userName: userName,
68+
userEmail: userEmail
69+
})
70+
}
71+
72+
return (
73+
<div className="App">
74+
<main>
75+
<h1>Zoom Meeting SDK Sample React</h1>
76+
77+
{/* For Component View */}
78+
<div id="meetingSDKElement">
79+
{/* Zoom Meeting SDK Component View Rendered Here */}
80+
</div>
81+
82+
<button onClick={getSignature}>Join Meeting</button>
83+
</main>
84+
</div>
85+
);
86+
}
87+
88+
export default App;

src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import './App.css';
44

55
declare var ZoomMtg
66

7-
ZoomMtg.setZoomJSLib('https://source.zoom.us/1.9.9/lib', '/av');
7+
ZoomMtg.setZoomJSLib('https://source.zoom.us/2.0.1/lib', '/av');
88

99
ZoomMtg.preLoadWasm();
1010
ZoomMtg.prepareWebSDK();

0 commit comments

Comments
 (0)