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,15 +222,22 @@ 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)) {
// We receive 2 updates of the session status ON. The first one is from jibri when it joins.
// The second one is from jicofo which will deliever the initiator value. Since the start
// recording notification uses the initiator value we skip the jibri update and show the
// notification on the update from jicofo.
// 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') { if (typeof recordingLimit === 'object') {
// Show notification with additional information to the initiator.
dispatch(showRecordingLimitNotification(mode)); dispatch(showRecordingLimitNotification(mode));
} else { } else {
dispatch(showStartedRecordingNotification(mode, initiator, action.sessionData.id)); dispatch(showStartedRecordingNotification(mode, initiator, action.sessionData.id));
} }
}
if (!oldSessionData || oldSessionData.status !== ON) {
sendAnalytics(createRecordingEvent('start', mode)); sendAnalytics(createRecordingEvent('start', mode));
let soundID; let soundID;
@ -248,6 +255,7 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => async action =>
if (typeof APP !== 'undefined') { if (typeof APP !== 'undefined') {
APP.API.notifyRecordingStatusChanged(true, mode); APP.API.notifyRecordingStatusChanged(true, mode);
} }
}
} else if (updatedSessionData.status === OFF } else if (updatedSessionData.status === OFF
&& (!oldSessionData || oldSessionData.status !== OFF)) { && (!oldSessionData || oldSessionData.status !== OFF)) {
if (terminator) { if (terminator) {