feat(notification,external-api) notify bridge channel failures

This commit is contained in:
Saúl Ibarra Corretgé 2022-11-15 16:54:24 +01:00 committed by Saúl Ibarra Corretgé
parent 55b80c948f
commit f38c9f5450
6 changed files with 62 additions and 1 deletions

View File

@ -44,6 +44,7 @@ import {
conferenceUniqueIdSet, conferenceUniqueIdSet,
conferenceWillJoin, conferenceWillJoin,
conferenceWillLeave, conferenceWillLeave,
dataChannelClosed,
dataChannelOpened, dataChannelOpened,
e2eRttChanged, e2eRttChanged,
getConferenceOptions, getConferenceOptions,
@ -134,9 +135,11 @@ import {
import { maybeSetLobbyChatMessageListener } from './react/features/lobby/actions.any'; import { maybeSetLobbyChatMessageListener } from './react/features/lobby/actions.any';
import { setNoiseSuppressionEnabled } from './react/features/noise-suppression/actions'; import { setNoiseSuppressionEnabled } from './react/features/noise-suppression/actions';
import { import {
DATA_CHANNEL_CLOSED_NOTIFICATION_ID,
NOTIFICATION_TIMEOUT_TYPE, NOTIFICATION_TIMEOUT_TYPE,
isModerationNotificationDisplayed, isModerationNotificationDisplayed,
showNotification showNotification,
showWarningNotification
} from './react/features/notifications'; } from './react/features/notifications';
import { mediaPermissionPromptVisibilityChanged } from './react/features/overlay'; import { mediaPermissionPromptVisibilityChanged } from './react/features/overlay';
import { suspendDetected } from './react/features/power-monitor'; import { suspendDetected } from './react/features/power-monitor';
@ -2070,6 +2073,17 @@ export default {
} }
); );
room.on(
JitsiConferenceEvents.DATA_CHANNEL_CLOSED, ev => {
APP.store.dispatch(dataChannelClosed(ev.code, ev.reason));
APP.store.dispatch(showWarningNotification({
descriptionKey: 'notify.dataChannelClosedDescription',
titleKey: 'notify.dataChannelClosed',
uid: DATA_CHANNEL_CLOSED_NOTIFICATION_ID
}, NOTIFICATION_TIMEOUT_TYPE.STICKY));
}
);
// call hangup // call hangup
APP.UI.addListener(UIEvents.HANGUP, () => { APP.UI.addListener(UIEvents.HANGUP, () => {
this.hangup(true); this.hangup(true);

View File

@ -649,6 +649,8 @@
"connectedOneMember": "{{name}} joined the meeting", "connectedOneMember": "{{name}} joined the meeting",
"connectedThreePlusMembers": "{{name}} and many others joined the meeting", "connectedThreePlusMembers": "{{name}} and many others joined the meeting",
"connectedTwoMembers": "{{first}} and {{second}} joined the meeting", "connectedTwoMembers": "{{first}} and {{second}} joined the meeting",
"dataChannelClosed": "Video quality impaired",
"dataChannelClosedDescription": "The bridge channel has been disconnected and thus video quality is limited to its lowest setting.",
"disconnected": "disconnected", "disconnected": "disconnected",
"displayNotifications": "Display notifications for", "displayNotifications": "Display notifications for",
"focus": "Conference focus", "focus": "Conference focus",

View File

@ -138,6 +138,18 @@ export const CONFERENCE_WILL_LEAVE = 'CONFERENCE_WILL_LEAVE';
*/ */
export const DATA_CHANNEL_OPENED = 'DATA_CHANNEL_OPENED'; export const DATA_CHANNEL_OPENED = 'DATA_CHANNEL_OPENED';
/**
* The type of (redux) action which signals that the data channel with the
* bridge has been closed.
*
* {
* type: DATA_CHANNEL_CLOSED,
* code: number,
* reason: string
* }
*/
export const DATA_CHANNEL_CLOSED = 'DATA_CHANNEL_CLOSED';
/** /**
* The type of action which signals that the user has been kicked out from * The type of action which signals that the user has been kicked out from
* the conference. * the conference.

View File

@ -41,6 +41,7 @@ import {
CONFERENCE_UNIQUE_ID_SET, CONFERENCE_UNIQUE_ID_SET,
CONFERENCE_WILL_JOIN, CONFERENCE_WILL_JOIN,
CONFERENCE_WILL_LEAVE, CONFERENCE_WILL_LEAVE,
DATA_CHANNEL_CLOSED,
DATA_CHANNEL_OPENED, DATA_CHANNEL_OPENED,
E2E_RTT_CHANGED, E2E_RTT_CHANGED,
KICKED_OUT, KICKED_OUT,
@ -581,6 +582,26 @@ export function dataChannelOpened() {
}; };
} }
/**
* Signals the data channel with the bridge was abruptly closed.
*
* @param {number} code - Close code.
* @param {string} reason - Close reason.
*
* @returns {{
* type: DATA_CHANNEL_CLOSED,
* code: number,
* reason: string
* }}
*/
export function dataChannelClosed(code: number, reason: string) {
return {
type: DATA_CHANNEL_CLOSED,
code,
reason
};
}
/** /**
* Action to end a conference for all participants. * Action to end a conference for all participants.
* *

View File

@ -3,6 +3,7 @@ import { getJitsiMeetTransport } from '../../../modules/transport';
import { import {
CONFERENCE_FAILED, CONFERENCE_FAILED,
CONFERENCE_JOINED, CONFERENCE_JOINED,
DATA_CHANNEL_CLOSED,
DATA_CHANNEL_OPENED, DATA_CHANNEL_OPENED,
KICKED_OUT KICKED_OUT
} from '../base/conference/actionTypes'; } from '../base/conference/actionTypes';
@ -124,6 +125,10 @@ MiddlewareRegistry.register(store => next => action => {
break; break;
} }
case DATA_CHANNEL_CLOSED:
APP.API.notifyDataChannelClosed(action.code, action.reason);
break;
case DATA_CHANNEL_OPENED: case DATA_CHANNEL_OPENED:
APP.API.notifyDataChannelOpened(); APP.API.notifyDataChannelOpened();
break; break;

View File

@ -56,6 +56,13 @@ export const NOTIFICATION_ICON = {
PARTICIPANTS: 'participants' PARTICIPANTS: 'participants'
}; };
/**
* The identifier of the disable self view notification.
*
* @type {string}
*/
export const DATA_CHANNEL_CLOSED_NOTIFICATION_ID = 'DATA_CHANNEL_CLOSED_NOTIFICATION_ID';
/** /**
* The identifier of the disable self view notification. * The identifier of the disable self view notification.
* *