Browse Source

feat(config): Add config option to allow unsetting local video flip

master
Vlad Piersec 4 years ago
parent
commit
7fce181080

+ 4
- 0
config.js View File

618
     // the menu has option to flip the locally seen video for local presentations
618
     // the menu has option to flip the locally seen video for local presentations
619
     // disableLocalVideoFlip: false,
619
     // disableLocalVideoFlip: false,
620
 
620
 
621
+    // A property used to unset the default flip state of the local video.
622
+    // When it is set to 'true', the local(self) video will not be mirrored anymore.
623
+    // doNotFlipLocalVideo: false,
624
+
621
     // Mainly privacy related settings
625
     // Mainly privacy related settings
622
 
626
 
623
     // Disables all invite functions from the app (share, invite, dial out...etc)
627
     // Disables all invite functions from the app (share, invite, dial out...etc)

+ 1
- 0
react/features/base/config/configWhitelist.js View File

97
     'disableTileView',
97
     'disableTileView',
98
     'displayJids',
98
     'displayJids',
99
     'doNotStoreRoom',
99
     'doNotStoreRoom',
100
+    'doNotFlipLocalVideo',
100
     'dropbox',
101
     'dropbox',
101
     'e2eping',
102
     'e2eping',
102
     'enableDisplayNameInStats',
103
     'enableDisplayNameInStats',

+ 35
- 1
react/features/base/config/middleware.js View File

6
 import { getFeatureFlag } from '../flags/functions';
6
 import { getFeatureFlag } from '../flags/functions';
7
 import { addKnownDomains } from '../known-domains';
7
 import { addKnownDomains } from '../known-domains';
8
 import { MiddlewareRegistry } from '../redux';
8
 import { MiddlewareRegistry } from '../redux';
9
+import { updateSettings } from '../settings';
9
 import { parseURIString } from '../util';
10
 import { parseURIString } from '../util';
10
 
11
 
11
-import { SET_CONFIG } from './actionTypes';
12
+import { SET_CONFIG, OVERWRITE_CONFIG } from './actionTypes';
12
 import { updateConfig } from './actions';
13
 import { updateConfig } from './actions';
13
 import { _CONFIG_STORE_PREFIX } from './constants';
14
 import { _CONFIG_STORE_PREFIX } from './constants';
14
 
15
 
26
 
27
 
27
     case SET_CONFIG:
28
     case SET_CONFIG:
28
         return _setConfig(store, next, action);
29
         return _setConfig(store, next, action);
30
+
31
+    case OVERWRITE_CONFIG:
32
+        return _updateSettings(store, next, action);
29
     }
33
     }
30
 
34
 
31
     return next(action);
35
     return next(action);
115
         config.resolution = resolutionFlag;
119
         config.resolution = resolutionFlag;
116
     }
120
     }
117
 
121
 
122
+    if (action.config.doNotFlipLocalVideo === true) {
123
+        dispatch(updateSettings({
124
+            localFlipX: false
125
+        }));
126
+    }
127
+
118
     dispatch(updateConfig(config));
128
     dispatch(updateConfig(config));
119
 
129
 
120
     // FIXME On Web we rely on the global 'config' variable which gets altered
130
     // FIXME On Web we rely on the global 'config' variable which gets altered
128
 
138
 
129
     return result;
139
     return result;
130
 }
140
 }
141
+
142
+/**
143
+ * Updates settings based on some config values.
144
+ *
145
+ * @param {Store} store - The redux store in which the specified {@code action}
146
+ * is being dispatched.
147
+ * @param {Dispatch} next - The redux {@code dispatch} function to dispatch the
148
+ * specified {@code action} in the specified {@code store}.
149
+ * @param {Action} action - The redux action which is being {@code dispatch}ed
150
+ * in the specified {@code store}.
151
+ * @private
152
+ * @returns {*} The return value of {@code next(action)}.
153
+ */
154
+function _updateSettings({ dispatch }, next, action) {
155
+    const { config: { doNotFlipLocalVideo } } = action;
156
+
157
+    if (doNotFlipLocalVideo === true) {
158
+        dispatch(updateSettings({
159
+            localFlipX: false
160
+        }));
161
+    }
162
+
163
+    return next(action);
164
+}

Loading…
Cancel
Save