Просмотр исходного кода

feat(notifications): Manage audio notifications

master
Horatiu Muresan 5 лет назад
Родитель
Сommit
7f1eb83dbd

+ 3
- 0
config.js Просмотреть файл

@@ -390,6 +390,9 @@ var config = {
390 390
         // userRegion: "asia"
391 391
     },
392 392
 
393
+    // Decides whether the start/stop recording audio notifications should play on record.
394
+    // disableRecordAudioNotification: false,
395
+
393 396
     // Information for the chrome extension banner
394 397
     // chromeExtensionBanner: {
395 398
     //     // The chrome extension to be installed address

+ 3
- 1
react/features/base/config/configWhitelist.js Просмотреть файл

@@ -1,3 +1,5 @@
1
+import extraConfigWhitelist from './extraConfigWhitelist';
2
+
1 3
 /**
2 4
  * The config keys to whitelist, the keys that can be overridden.
3 5
  * Currently we can only whitelist the first part of the properties, like
@@ -145,4 +147,4 @@ export default [
145 147
     'useStunTurn',
146 148
     'webrtcIceTcpDisable',
147 149
     'webrtcIceUdpDisable'
148
-];
150
+].concat(extraConfigWhitelist);

+ 4
- 0
react/features/base/config/extraConfigWhitelist.js Просмотреть файл

@@ -0,0 +1,4 @@
1
+/**
2
+ * Deploy-specific configuration whitelists
3
+ */
4
+export default [];

+ 12
- 3
react/features/recording/middleware.js Просмотреть файл

@@ -130,7 +130,8 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
130 130
         // but we want to indicate those in case of sip gateway
131 131
         const {
132 132
             iAmRecorder,
133
-            iAmSipGateway
133
+            iAmSipGateway,
134
+            disableRecordAudioNotification
134 135
         } = getState()['features/base/config'];
135 136
 
136 137
         if (iAmRecorder && !iAmSipGateway) {
@@ -153,6 +154,11 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
153 154
                 const initiatorName = initiator && getParticipantDisplayName(getState, initiator.getId());
154 155
 
155 156
                 initiatorName && dispatch(showStartedRecordingNotification(mode, initiatorName));
157
+                sendAnalytics(createRecordingEvent('start', mode));
158
+
159
+                if (disableRecordAudioNotification) {
160
+                    break;
161
+                }
156 162
 
157 163
                 let soundID;
158 164
 
@@ -163,7 +169,6 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
163 169
                 }
164 170
 
165 171
                 if (soundID) {
166
-                    sendAnalytics(createRecordingEvent('start', mode));
167 172
                     dispatch(playSound(soundID));
168 173
                 }
169 174
             } else if (updatedSessionData.status === OFF
@@ -176,6 +181,11 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
176 181
                     duration
177 182
                         = (Date.now() / 1000) - oldSessionData.timestamp;
178 183
                 }
184
+                sendAnalytics(createRecordingEvent('stop', mode, duration));
185
+
186
+                if (disableRecordAudioNotification) {
187
+                    break;
188
+                }
179 189
 
180 190
                 if (mode === JitsiRecordingConstants.mode.FILE) {
181 191
                     soundOff = RECORDING_OFF_SOUND_ID;
@@ -186,7 +196,6 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
186 196
                 }
187 197
 
188 198
                 if (soundOff && soundOn) {
189
-                    sendAnalytics(createRecordingEvent('stop', mode, duration));
190 199
                     dispatch(stopSound(soundOn));
191 200
                     dispatch(playSound(soundOff));
192 201
                 }

Загрузка…
Отмена
Сохранить