feat(notifications): Manage audio notifications
This commit is contained in:
parent
6e4c1f64d8
commit
7f1eb83dbd
|
@ -390,6 +390,9 @@ var config = {
|
||||||
// userRegion: "asia"
|
// userRegion: "asia"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Decides whether the start/stop recording audio notifications should play on record.
|
||||||
|
// disableRecordAudioNotification: false,
|
||||||
|
|
||||||
// Information for the chrome extension banner
|
// Information for the chrome extension banner
|
||||||
// chromeExtensionBanner: {
|
// chromeExtensionBanner: {
|
||||||
// // The chrome extension to be installed address
|
// // The chrome extension to be installed address
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import extraConfigWhitelist from './extraConfigWhitelist';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The config keys to whitelist, the keys that can be overridden.
|
* The config keys to whitelist, the keys that can be overridden.
|
||||||
* Currently we can only whitelist the first part of the properties, like
|
* Currently we can only whitelist the first part of the properties, like
|
||||||
|
@ -145,4 +147,4 @@ export default [
|
||||||
'useStunTurn',
|
'useStunTurn',
|
||||||
'webrtcIceTcpDisable',
|
'webrtcIceTcpDisable',
|
||||||
'webrtcIceUdpDisable'
|
'webrtcIceUdpDisable'
|
||||||
];
|
].concat(extraConfigWhitelist);
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
/**
|
||||||
|
* Deploy-specific configuration whitelists
|
||||||
|
*/
|
||||||
|
export default [];
|
|
@ -130,7 +130,8 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
|
||||||
// but we want to indicate those in case of sip gateway
|
// but we want to indicate those in case of sip gateway
|
||||||
const {
|
const {
|
||||||
iAmRecorder,
|
iAmRecorder,
|
||||||
iAmSipGateway
|
iAmSipGateway,
|
||||||
|
disableRecordAudioNotification
|
||||||
} = getState()['features/base/config'];
|
} = getState()['features/base/config'];
|
||||||
|
|
||||||
if (iAmRecorder && !iAmSipGateway) {
|
if (iAmRecorder && !iAmSipGateway) {
|
||||||
|
@ -153,6 +154,11 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
|
||||||
const initiatorName = initiator && getParticipantDisplayName(getState, initiator.getId());
|
const initiatorName = initiator && getParticipantDisplayName(getState, initiator.getId());
|
||||||
|
|
||||||
initiatorName && dispatch(showStartedRecordingNotification(mode, initiatorName));
|
initiatorName && dispatch(showStartedRecordingNotification(mode, initiatorName));
|
||||||
|
sendAnalytics(createRecordingEvent('start', mode));
|
||||||
|
|
||||||
|
if (disableRecordAudioNotification) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
let soundID;
|
let soundID;
|
||||||
|
|
||||||
|
@ -163,7 +169,6 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (soundID) {
|
if (soundID) {
|
||||||
sendAnalytics(createRecordingEvent('start', mode));
|
|
||||||
dispatch(playSound(soundID));
|
dispatch(playSound(soundID));
|
||||||
}
|
}
|
||||||
} else if (updatedSessionData.status === OFF
|
} else if (updatedSessionData.status === OFF
|
||||||
|
@ -176,6 +181,11 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
|
||||||
duration
|
duration
|
||||||
= (Date.now() / 1000) - oldSessionData.timestamp;
|
= (Date.now() / 1000) - oldSessionData.timestamp;
|
||||||
}
|
}
|
||||||
|
sendAnalytics(createRecordingEvent('stop', mode, duration));
|
||||||
|
|
||||||
|
if (disableRecordAudioNotification) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (mode === JitsiRecordingConstants.mode.FILE) {
|
if (mode === JitsiRecordingConstants.mode.FILE) {
|
||||||
soundOff = RECORDING_OFF_SOUND_ID;
|
soundOff = RECORDING_OFF_SOUND_ID;
|
||||||
|
@ -186,7 +196,6 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (soundOff && soundOn) {
|
if (soundOff && soundOn) {
|
||||||
sendAnalytics(createRecordingEvent('stop', mode, duration));
|
|
||||||
dispatch(stopSound(soundOn));
|
dispatch(stopSound(soundOn));
|
||||||
dispatch(playSound(soundOff));
|
dispatch(playSound(soundOff));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue