Newer
Older
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import React from 'react';
import { render } from 'react-dom';
import {
RemoteControl,
setupScreenSharingForWindow,
setupAlwaysOnTopRender,
setupWiFiStats
} from 'jitsi-meet-electron-utils';
import { jitsiMeetDomain } from '../../../config.js';
/**
* Jitsi Meet Window Component
*/
class JitsiMeetWindow extends React.Component {
/**
* Render function of component
* @return {ScriptElement}
*/
render() {
return null;
}
/**
* Attach the script
*/
componentDidMount() {
const script = document.createElement('script');
script.async = true;
script.onload = this._onScriptLoad;
script.onerror = console.error;
script.src = `https://${jitsiMeetDomain}/external_api.js`;
document.head.appendChild(script);
}
/**
* When the script is loaded attach utils from jitsi-meet-electron-utils
*/
_onScriptLoad() {
const JitsiMeetExternalAPI = window.JitsiMeetExternalAPI;
const api = new JitsiMeetExternalAPI(jitsiMeetDomain);
const iframe = api.getIFrame();
setupScreenSharingForWindow(iframe);
new RemoteControl(iframe);
setupAlwaysOnTopRender(api);
setupWiFiStats(iframe);
}
}
render(<JitsiMeetWindow />, document.getElementById('app'));