fix(recording): recording link.

Show the start recording notification on jicofo update only. This way
the initiator will be available and we will be able to fetch and display
recording link and send iframe API event.
This commit is contained in:
Hristo Terezov 2022-10-20 19:17:10 -05:00
parent 7249406960
commit 9e1ac3bea6
1 changed files with 28 additions and 20 deletions

View File

@ -222,31 +222,39 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => async action =>
} else if (updatedSessionData.status !== PENDING) { } else if (updatedSessionData.status !== PENDING) {
dispatch(hidePendingRecordingNotification(mode)); dispatch(hidePendingRecordingNotification(mode));
if (updatedSessionData.status === ON if (updatedSessionData.status === ON) {
&& (!oldSessionData || oldSessionData.status !== ON)) {
if (typeof recordingLimit === 'object') { // We receive 2 updates of the session status ON. The first one is from jibri when it joins.
// Show notification with additional information to the initiator. // The second one is from jicofo which will deliever the initiator value. Since the start
dispatch(showRecordingLimitNotification(mode)); // recording notification uses the initiator value we skip the jibri update and show the
} else { // notification on the update from jicofo.
dispatch(showStartedRecordingNotification(mode, initiator, action.sessionData.id)); // FIXE: simplify checks when the backend start sending only one status ON update containing the
// initiator.
if (initiator && (!oldSessionData || !oldSessionData.initiator)) {
if (typeof recordingLimit === 'object') {
dispatch(showRecordingLimitNotification(mode));
} else {
dispatch(showStartedRecordingNotification(mode, initiator, action.sessionData.id));
}
} }
if (!oldSessionData || oldSessionData.status !== ON) {
sendAnalytics(createRecordingEvent('start', mode));
sendAnalytics(createRecordingEvent('start', mode)); let soundID;
let soundID; if (mode === JitsiRecordingConstants.mode.FILE) {
soundID = RECORDING_ON_SOUND_ID;
} else if (mode === JitsiRecordingConstants.mode.STREAM) {
soundID = LIVE_STREAMING_ON_SOUND_ID;
}
if (mode === JitsiRecordingConstants.mode.FILE) { if (soundID) {
soundID = RECORDING_ON_SOUND_ID; dispatch(playSound(soundID));
} else if (mode === JitsiRecordingConstants.mode.STREAM) { }
soundID = LIVE_STREAMING_ON_SOUND_ID;
}
if (soundID) { if (typeof APP !== 'undefined') {
dispatch(playSound(soundID)); APP.API.notifyRecordingStatusChanged(true, mode);
} }
if (typeof APP !== 'undefined') {
APP.API.notifyRecordingStatusChanged(true, mode);
} }
} else if (updatedSessionData.status === OFF } else if (updatedSessionData.status === OFF
&& (!oldSessionData || oldSessionData.status !== OFF)) { && (!oldSessionData || oldSessionData.status !== OFF)) {