ソースを参照

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

master
Vlad Piersec 4年前
コミット
7fce181080
3個のファイルの変更40行の追加1行の削除
  1. 4
    0
      config.js
  2. 1
    0
      react/features/base/config/configWhitelist.js
  3. 35
    1
      react/features/base/config/middleware.js

+ 4
- 0
config.js ファイルの表示

@@ -618,6 +618,10 @@ var config = {
618 618
     // the menu has option to flip the locally seen video for local presentations
619 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 625
     // Mainly privacy related settings
622 626
 
623 627
     // Disables all invite functions from the app (share, invite, dial out...etc)

+ 1
- 0
react/features/base/config/configWhitelist.js ファイルの表示

@@ -97,6 +97,7 @@ export default [
97 97
     'disableTileView',
98 98
     'displayJids',
99 99
     'doNotStoreRoom',
100
+    'doNotFlipLocalVideo',
100 101
     'dropbox',
101 102
     'e2eping',
102 103
     'enableDisplayNameInStats',

+ 35
- 1
react/features/base/config/middleware.js ファイルの表示

@@ -6,9 +6,10 @@ import { APP_WILL_MOUNT } from '../app';
6 6
 import { getFeatureFlag } from '../flags/functions';
7 7
 import { addKnownDomains } from '../known-domains';
8 8
 import { MiddlewareRegistry } from '../redux';
9
+import { updateSettings } from '../settings';
9 10
 import { parseURIString } from '../util';
10 11
 
11
-import { SET_CONFIG } from './actionTypes';
12
+import { SET_CONFIG, OVERWRITE_CONFIG } from './actionTypes';
12 13
 import { updateConfig } from './actions';
13 14
 import { _CONFIG_STORE_PREFIX } from './constants';
14 15
 
@@ -26,6 +27,9 @@ MiddlewareRegistry.register(store => next => action => {
26 27
 
27 28
     case SET_CONFIG:
28 29
         return _setConfig(store, next, action);
30
+
31
+    case OVERWRITE_CONFIG:
32
+        return _updateSettings(store, next, action);
29 33
     }
30 34
 
31 35
     return next(action);
@@ -115,6 +119,12 @@ function _setConfig({ dispatch, getState }, next, action) {
115 119
         config.resolution = resolutionFlag;
116 120
     }
117 121
 
122
+    if (action.config.doNotFlipLocalVideo === true) {
123
+        dispatch(updateSettings({
124
+            localFlipX: false
125
+        }));
126
+    }
127
+
118 128
     dispatch(updateConfig(config));
119 129
 
120 130
     // FIXME On Web we rely on the global 'config' variable which gets altered
@@ -128,3 +138,27 @@ function _setConfig({ dispatch, getState }, next, action) {
128 138
 
129 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
+}

読み込み中…
キャンセル
保存