Browse Source

feat(notifications): Manage audio notifications

j8
Horatiu Muresan 5 years ago
parent
commit
7f1eb83dbd

+ 3
- 0
config.js View File

390
         // userRegion: "asia"
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
     // Information for the chrome extension banner
396
     // Information for the chrome extension banner
394
     // chromeExtensionBanner: {
397
     // chromeExtensionBanner: {
395
     //     // The chrome extension to be installed address
398
     //     // The chrome extension to be installed address

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

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

+ 4
- 0
react/features/base/config/extraConfigWhitelist.js View File

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

+ 12
- 3
react/features/recording/middleware.js View File

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

Loading…
Cancel
Save