瀏覽代碼

ref(toolbar): show recording features based on explicit configs (#3080)

* ref(toolbar): show recording features based on explicit configs

* squash: bring back button configs, use final config names

* squash: update interfaceConfig comment, remove unused config whitelist

* squash: change order of button enabled checks to reduce diff

* squash: fileRecording -> fileRecordings
master
virtuacoplenny 6 年之前
父節點
當前提交
84f303dd3c
共有 6 個檔案被更改,包括 31 行新增31 行删除
  1. 0
    7
      conference.js
  2. 4
    4
      config.js
  3. 5
    6
      interface_config.js
  4. 1
    1
      modules/UI/UI.js
  5. 2
    2
      react/features/base/config/functions.js
  6. 19
    11
      react/features/toolbox/components/web/Toolbox.js

+ 0
- 7
conference.js 查看文件

@@ -1255,13 +1255,6 @@ export default {
1255 1255
     _getConferenceOptions() {
1256 1256
         const options = config;
1257 1257
 
1258
-        if (config.enableRecording && !config.recordingType) {
1259
-            options.recordingType
1260
-                = config.hosts && (typeof config.hosts.jirecon !== 'undefined')
1261
-                    ? 'jirecon'
1262
-                    : 'colibri';
1263
-        }
1264
-
1265 1258
         const nick = APP.store.getState()['features/base/settings'].displayName;
1266 1259
 
1267 1260
         if (nick) {

+ 4
- 4
config.js 查看文件

@@ -167,11 +167,11 @@ var config = {
167 167
 
168 168
     // Recording
169 169
 
170
-    // Whether to enable recording or not.
171
-    // enableRecording: false,
170
+    // Whether to enable file recording or not.
171
+    // fileRecordingsEnabled: false,
172 172
 
173
-    // Type for recording: one of jibri or jirecon.
174
-    // recordingType: 'jibri',
173
+    // Whether to enable live streaming or not.
174
+    // liveStreamingEnabled: false,
175 175
 
176 176
     // Misc
177 177
 

+ 5
- 6
interface_config.js 查看文件

@@ -38,15 +38,14 @@ var interfaceConfig = {
38 38
     AUTHENTICATION_ENABLE: true,
39 39
 
40 40
     /**
41
-     * the toolbar buttons line is intentionally left in one line, to be able
42
-     * to easily override values or remove them using regex
41
+     * The name of the toolbar buttons to display in the toolbar. If present,
42
+     * the button will display. Exceptions are "livestreaming" and "recording"
43
+     * which also require being a moderator and some values in config.js to be
44
+     * enabled. Also, the "profile" button will not display for user's with a
45
+     * jwt.
43 46
      */
44 47
     TOOLBAR_BUTTONS: [
45
-
46
-        // main toolbar
47 48
         'microphone', 'camera', 'desktop', 'fullscreen', 'fodeviceselection', 'hangup',
48
-
49
-        // extended toolbar
50 49
         'profile', 'info', 'chat', 'recording', 'livestreaming', 'etherpad',
51 50
         'sharedvideo', 'settings', 'raisehand', 'videoquality', 'filmstrip',
52 51
         'invite', 'feedback', 'stats', 'shortcuts'

+ 1
- 1
modules/UI/UI.js 查看文件

@@ -351,7 +351,7 @@ UI.start = function() {
351 351
         APP.store.dispatch(setNotificationsEnabled(false));
352 352
     } else {
353 353
         // Initialize recording mode UI.
354
-        if (config.enableRecording && config.iAmRecorder) {
354
+        if (config.iAmRecorder) {
355 355
             VideoLayout.enableDeviceAvailabilityIcons(
356 356
                 APP.conference.getMyUserId(), false);
357 357
 

+ 2
- 2
react/features/base/config/functions.js 查看文件

@@ -87,7 +87,6 @@ const WHITELISTED_KEYS = [
87 87
     'enableDisplayNameInStats',
88 88
     'enableLipSync',
89 89
     'enableLocalVideoFlip',
90
-    'enableRecording',
91 90
     'enableRemb',
92 91
     'enableStatsID',
93 92
     'enableTalkWhileMuted',
@@ -95,6 +94,7 @@ const WHITELISTED_KEYS = [
95 94
     'enableUserRolesBasedOnToken',
96 95
     'etherpad_base',
97 96
     'failICE',
97
+    'fileRecordingsEnabled',
98 98
     'firefox_fake_device',
99 99
     'forceJVB121Ratio',
100 100
     'gatherStats',
@@ -105,12 +105,12 @@ const WHITELISTED_KEYS = [
105 105
     'iAmSipGateway',
106 106
     'iceTransportPolicy',
107 107
     'ignoreStartMuted',
108
+    'liveStreamingEnabled',
108 109
     'minParticipants',
109 110
     'nick',
110 111
     'openBridgeChannel',
111 112
     'p2p',
112 113
     'preferH264',
113
-    'recordingType',
114 114
     'requireDisplayName',
115 115
     'resolution',
116 116
     'startAudioMuted',

+ 19
- 11
react/features/toolbox/components/web/Toolbox.js 查看文件

@@ -103,6 +103,11 @@ type Props = {
103 103
      */
104 104
     _feedbackConfigured: boolean,
105 105
 
106
+    /**
107
+     * Whether or not the file recording feature is enabled for use.
108
+     */
109
+    _fileRecordingsEnabled: boolean,
110
+
106 111
     /**
107 112
      * The current file recording session, if any.
108 113
      */
@@ -124,6 +129,11 @@ type Props = {
124 129
      */
125 130
     _isGuest: boolean,
126 131
 
132
+    /**
133
+     * Whether or not the live streaming feature is enabled for use.
134
+     */
135
+    _liveStreamingEnabled: boolean,
136
+
127 137
     /**
128 138
      * The current live streaming session, if any.
129 139
      */
@@ -144,11 +154,6 @@ type Props = {
144 154
      */
145 155
     _raisedHand: boolean,
146 156
 
147
-    /**
148
-     * Whether or not the recording feature is enabled for use.
149
-     */
150
-    _recordingEnabled: boolean,
151
-
152 157
     /**
153 158
      * Whether or not the local participant is screensharing.
154 159
      */
@@ -959,10 +964,11 @@ class Toolbox extends Component<Props> {
959 964
             _editingDocument,
960 965
             _etherpadInitialized,
961 966
             _feedbackConfigured,
967
+            _fileRecordingsEnabled,
962 968
             _fullScreen,
963 969
             _isGuest,
970
+            _liveStreamingEnabled,
964 971
             _liveStreamingSession,
965
-            _recordingEnabled,
966 972
             _sharingVideo,
967 973
             t
968 974
         } = this.props;
@@ -988,13 +994,13 @@ class Toolbox extends Component<Props> {
988 994
                     text = { _fullScreen
989 995
                         ? t('toolbar.exitFullScreen')
990 996
                         : t('toolbar.enterFullScreen') } />,
991
-            _recordingEnabled
997
+            _liveStreamingEnabled
992 998
                 && this._shouldShowButton('livestreaming')
993 999
                 && <OverflowMenuLiveStreamingItem
994 1000
                     key = 'livestreaming'
995 1001
                     onClick = { this._onToolbarToggleLiveStreaming }
996 1002
                     session = { _liveStreamingSession } />,
997
-            _recordingEnabled
1003
+            _fileRecordingsEnabled
998 1004
                 && this._shouldShowButton('recording')
999 1005
                 && this._renderRecordingButton(),
1000 1006
             this._shouldShowButton('sharedvideo')
@@ -1100,8 +1106,9 @@ function _mapStateToProps(state) {
1100 1106
     const {
1101 1107
         callStatsID,
1102 1108
         disableDesktopSharing,
1103
-        enableRecording,
1104
-        iAmRecorder
1109
+        fileRecordingsEnabled,
1110
+        iAmRecorder,
1111
+        liveStreamingEnabled
1105 1112
     } = state['features/base/config'];
1106 1113
     const sharedVideoStatus = state['features/shared-video'].status;
1107 1114
     const { current } = state['features/side-panel'];
@@ -1130,15 +1137,16 @@ function _mapStateToProps(state) {
1130 1137
         _hideInviteButton:
1131 1138
             iAmRecorder || (!addPeopleEnabled && !dialOutEnabled),
1132 1139
         _isGuest: state['features/base/jwt'].isGuest,
1140
+        _fileRecordingsEnabled: isModerator && fileRecordingsEnabled,
1133 1141
         _fileRecordingSession:
1134 1142
             getActiveSession(state, JitsiRecordingConstants.mode.FILE),
1135 1143
         _fullScreen: fullScreen,
1144
+        _liveStreamingEnabled: isModerator && liveStreamingEnabled,
1136 1145
         _liveStreamingSession:
1137 1146
              getActiveSession(state, JitsiRecordingConstants.mode.STREAM),
1138 1147
         _localParticipantID: localParticipant.id,
1139 1148
         _overflowMenuVisible: overflowMenuVisible,
1140 1149
         _raisedHand: localParticipant.raisedHand,
1141
-        _recordingEnabled: isModerator && enableRecording,
1142 1150
         _screensharing: localVideo && localVideo.videoType === 'desktop',
1143 1151
         _sharingVideo: sharedVideoStatus === 'playing'
1144 1152
             || sharedVideoStatus === 'start'

Loading…
取消
儲存