-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathApp.tsx
41 lines (33 loc) · 1.02 KB
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { useEffect } from 'react';
import { DyteProvider, useDyteClient } from '@dytesdk/react-web-core';
import Facetime from './components/Facetime';
function App() {
const [meeting, initMeeting] = useDyteClient();
useEffect(() => {
const searchParams = new URL(window.location.href).searchParams;
const authToken = searchParams.get('authToken');
if (!authToken) {
alert(
"An authToken wasn't passed, please pass an authToken in the URL query to join a meeting."
);
return;
}
initMeeting({
authToken,
defaults: {
video: false,
audio: false,
},
}).then((m) => m?.joinRoom());
}, []);
Object.assign(window, { meeting });
// By default this component will cover the entire viewport.
// To avoid that and to make it fill a parent container, pass the prop:
// `mode="fill"` to the component.
return (
<DyteProvider value={meeting} fallback={<div>Loading...</div>}>
<Facetime />
</DyteProvider>
);
}
export default App;