|
|
@@ -1,7 +1,7 @@
|
|
1
|
1
|
/* @flow */
|
|
2
|
2
|
|
|
3
|
3
|
import { createShortcutEvent, sendAnalytics } from '../analytics';
|
|
4
|
|
-import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../base/app';
|
|
|
4
|
+import { APP_WILL_UNMOUNT } from '../base/app';
|
|
5
|
5
|
import { CONFERENCE_JOINED } from '../base/conference';
|
|
6
|
6
|
import { toggleDialog } from '../base/dialog';
|
|
7
|
7
|
import { i18next } from '../base/i18n';
|
|
|
@@ -15,29 +15,23 @@ import { LocalRecordingInfoDialog } from './components';
|
|
15
|
15
|
import { recordingController } from './controller';
|
|
16
|
16
|
|
|
17
|
17
|
declare var APP: Object;
|
|
18
|
|
-declare var config: Object;
|
|
19
|
18
|
|
|
20
|
|
-const isFeatureEnabled = typeof config === 'object' && config.localRecording
|
|
21
|
|
- && config.localRecording.enabled === true;
|
|
22
|
|
-
|
|
23
|
|
-isFeatureEnabled
|
|
24
|
|
-&& MiddlewareRegistry.register(({ getState, dispatch }) => next => action => {
|
|
|
19
|
+MiddlewareRegistry.register(({ getState, dispatch }) => next => action => {
|
|
25
|
20
|
const result = next(action);
|
|
26
|
21
|
|
|
27
|
22
|
switch (action.type) {
|
|
28
|
23
|
case CONFERENCE_JOINED: {
|
|
29
|
|
- const { conference } = getState()['features/base/conference'];
|
|
30
|
24
|
const { localRecording } = getState()['features/base/config'];
|
|
|
25
|
+ const isLocalRecordingEnabled = Boolean(
|
|
|
26
|
+ localRecording
|
|
|
27
|
+ && localRecording.enabled
|
|
|
28
|
+ && typeof APP === 'object'
|
|
|
29
|
+ );
|
|
31
|
30
|
|
|
32
|
|
- if (localRecording && localRecording.format) {
|
|
33
|
|
- recordingController.switchFormat(localRecording.format);
|
|
|
31
|
+ if (!isLocalRecordingEnabled) {
|
|
|
32
|
+ break;
|
|
34
|
33
|
}
|
|
35
|
34
|
|
|
36
|
|
- recordingController.registerEvents(conference);
|
|
37
|
|
- break;
|
|
38
|
|
- }
|
|
39
|
|
- case APP_WILL_MOUNT:
|
|
40
|
|
-
|
|
41
|
35
|
// realize the delegates on recordingController, allowing the UI to
|
|
42
|
36
|
// react to state changes in recordingController.
|
|
43
|
37
|
recordingController.onStateChanged = isEngaged => {
|
|
|
@@ -69,7 +63,17 @@ isFeatureEnabled
|
|
69
|
63
|
sendAnalytics(createShortcutEvent('local.recording'));
|
|
70
|
64
|
dispatch(toggleDialog(LocalRecordingInfoDialog));
|
|
71
|
65
|
}, 'keyboardShortcuts.localRecording');
|
|
|
66
|
+
|
|
|
67
|
+ if (localRecording.format) {
|
|
|
68
|
+ recordingController.switchFormat(localRecording.format);
|
|
|
69
|
+ }
|
|
|
70
|
+
|
|
|
71
|
+ const { conference } = getState()['features/base/conference'];
|
|
|
72
|
+
|
|
|
73
|
+ recordingController.registerEvents(conference);
|
|
|
74
|
+
|
|
72
|
75
|
break;
|
|
|
76
|
+ }
|
|
73
|
77
|
case APP_WILL_UNMOUNT:
|
|
74
|
78
|
recordingController.onStateChanged = null;
|
|
75
|
79
|
recordingController.onNotify = null;
|