aboutsummaryrefslogtreecommitdiff
path: root/app/features
diff options
context:
space:
mode:
authorSaúl Ibarra Corretgé <s@saghul.net>2018-05-21 22:06:55 +0200
committerhristoterezov <hristo@jitsi.org>2018-05-23 17:02:15 -0500
commit42be5336146a0d7a3d2c448107e3025e2c553928 (patch)
tree8120f4e5bbb04341319fb5301f0e19c142474471 /app/features
parentcfcab5e00784598ee7121c190fda48886876d963 (diff)
Reorganize source code
Diffstat (limited to 'app/features')
-rw-r--r--app/features/app/components/App.js32
-rw-r--r--app/features/app/components/index.js1
-rw-r--r--app/features/app/index.js1
-rw-r--r--app/features/conference/components/Conference.js54
-rw-r--r--app/features/conference/components/index.js1
-rw-r--r--app/features/conference/index.js1
-rw-r--r--app/features/config/index.js12
7 files changed, 102 insertions, 0 deletions
diff --git a/app/features/app/components/App.js b/app/features/app/components/App.js
new file mode 100644
index 0000000..2afd502
--- /dev/null
+++ b/app/features/app/components/App.js
@@ -0,0 +1,32 @@
+import React, { Component } from 'react';
+
+import { Conference } from '../../conference';
+import config from '../../config';
+
+/**
+ * Main component encapsulating the entire application.
+ */
+export default class App extends Component {
+ /**
+ * Initializes a new {@code App} instance.
+ *
+ * @inheritdoc
+ */
+ constructor() {
+ super();
+
+ document.title = config.appName;
+ }
+
+ /**
+ * Implements React's {@link Component#render()}.
+ *
+ * @inheritdoc
+ * @returns {ReactElement}
+ */
+ render() {
+ return (
+ <Conference />
+ );
+ }
+}
diff --git a/app/features/app/components/index.js b/app/features/app/components/index.js
new file mode 100644
index 0000000..c866729
--- /dev/null
+++ b/app/features/app/components/index.js
@@ -0,0 +1 @@
+export { default as App } from './App';
diff --git a/app/features/app/index.js b/app/features/app/index.js
new file mode 100644
index 0000000..07635cb
--- /dev/null
+++ b/app/features/app/index.js
@@ -0,0 +1 @@
+export * from './components';
diff --git a/app/features/conference/components/Conference.js b/app/features/conference/components/Conference.js
new file mode 100644
index 0000000..e77ece9
--- /dev/null
+++ b/app/features/conference/components/Conference.js
@@ -0,0 +1,54 @@
+import { Component } from 'react';
+
+import {
+ RemoteControl,
+ setupScreenSharingForWindow,
+ setupAlwaysOnTopRender,
+ setupWiFiStats
+} from 'jitsi-meet-electron-utils';
+
+import config from '../../config';
+
+/**
+ * Jitsi Meet Window Component
+ */
+export default class Conference extends Component {
+ /**
+ * Attach the script
+ */
+ componentDidMount() {
+ const script = document.createElement('script');
+
+ script.async = true;
+ script.onload = this._onScriptLoad;
+ script.onerror = console.error;
+ script.src = `https://${config.defaultDomain}/external_api.js`;
+
+ document.head.appendChild(script);
+ }
+
+
+ /**
+ * Render function of component.
+ *
+ * @return {ReactElement}
+ */
+ render() {
+ return null;
+ }
+
+ /**
+ * When the script is loaded attach utils from jitsi-meet-electron-utils
+ */
+ _onScriptLoad() {
+ const JitsiMeetExternalAPI = window.JitsiMeetExternalAPI;
+
+ const api = new JitsiMeetExternalAPI(config.defaultDomain);
+ const iframe = api.getIFrame();
+
+ setupScreenSharingForWindow(iframe);
+ new RemoteControl(iframe);
+ setupAlwaysOnTopRender(api);
+ setupWiFiStats(iframe);
+ }
+}
diff --git a/app/features/conference/components/index.js b/app/features/conference/components/index.js
new file mode 100644
index 0000000..7ee56f5
--- /dev/null
+++ b/app/features/conference/components/index.js
@@ -0,0 +1 @@
+export { default as Conference } from './Conference';
diff --git a/app/features/conference/index.js b/app/features/conference/index.js
new file mode 100644
index 0000000..07635cb
--- /dev/null
+++ b/app/features/conference/index.js
@@ -0,0 +1 @@
+export * from './components';
diff --git a/app/features/config/index.js b/app/features/config/index.js
new file mode 100644
index 0000000..22d3806
--- /dev/null
+++ b/app/features/config/index.js
@@ -0,0 +1,12 @@
+
+export default {
+ /**
+ * Application name.
+ */
+ appName: 'Jitsi Meet',
+
+ /**
+ * The domain of the Jitsi Meet deployment that will be used.
+ */
+ defaultDomain: 'meet.jit.si'
+};