fix(local-recording) Notify external api about local recording (#11887)
This commit is contained in:
parent
c1e9724bba
commit
cb712eb4ab
|
@ -1599,7 +1599,7 @@ class API {
|
|||
* Notify external application (if API is enabled) that recording has started or stopped.
|
||||
*
|
||||
* @param {boolean} on - True if recording is on, false otherwise.
|
||||
* @param {string} mode - Stream or file.
|
||||
* @param {string} mode - Stream or file or local.
|
||||
* @param {string} error - Error type or null if success.
|
||||
* @returns {void}
|
||||
*/
|
||||
|
|
|
@ -153,6 +153,9 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => async action =>
|
|||
}, NOTIFICATION_TIMEOUT_TYPE.STICKY));
|
||||
dispatch(updateLocalRecordingStatus(true, onlySelf));
|
||||
sendAnalytics(createRecordingEvent('started', `local${onlySelf ? '.self' : ''}`));
|
||||
if (typeof APP !== 'undefined') {
|
||||
APP.API.notifyRecordingStatusChanged(true, 'local');
|
||||
}
|
||||
} catch (err) {
|
||||
logger.error('Capture failed', err);
|
||||
|
||||
|
@ -169,6 +172,10 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => async action =>
|
|||
titleKey: 'recording.failedToStart'
|
||||
};
|
||||
|
||||
if (typeof APP !== 'undefined') {
|
||||
APP.API.notifyRecordingStatusChanged(false, 'local', err.message);
|
||||
}
|
||||
|
||||
dispatch(showErrorNotification(props, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
|
||||
}
|
||||
break;
|
||||
|
@ -183,6 +190,9 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => async action =>
|
|||
if (localRecording?.notifyAllParticipants && !LocalRecordingManager.selfRecording) {
|
||||
dispatch(playSound(RECORDING_OFF_SOUND_ID));
|
||||
}
|
||||
if (typeof APP !== 'undefined') {
|
||||
APP.API.notifyRecordingStatusChanged(false, 'local');
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue