Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
feat(notification,external-api) notify bridge channel failures
Saúl Ibarra Corretgéf38c9f545009
diff --git a/conference.js b/conference.jsindex bd2eba3813..cd4737bb79 100644--- a/conference.js+++ b/conference.js@@ -44,6 +44,7 @@ import {conferenceUniqueIdSet,conferenceWillJoin,conferenceWillLeave,+ dataChannelClosed,dataChannelOpened,e2eRttChanged,getConferenceOptions,@@ -134,9 +135,11 @@ import {import { maybeSetLobbyChatMessageListener } from './react/features/lobby/actions.any';import { setNoiseSuppressionEnabled } from './react/features/noise-suppression/actions';import {+ DATA_CHANNEL_CLOSED_NOTIFICATION_ID,NOTIFICATION_TIMEOUT_TYPE,isModerationNotificationDisplayed,- showNotification+ showNotification,+ showWarningNotification} from './react/features/notifications';import { mediaPermissionPromptVisibilityChanged } from './react/features/overlay';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 hangupAPP.UI.addListener(UIEvents.HANGUP, () => {this.hangup(true);diff --git a/lang/main.json b/lang/main.jsonindex 114be7af66..1572b5b8d3 100644--- a/lang/main.json+++ b/lang/main.json@@ -649,6 +649,8 @@"connectedOneMember": "{{name}} joined the meeting","connectedThreePlusMembers": "{{name}} and many others 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","displayNotifications": "Display notifications for","focus": "Conference focus",diff --git a/react/features/base/conference/actionTypes.ts b/react/features/base/conference/actionTypes.tsindex a761656b33..b48ec201ef 100644--- a/react/features/base/conference/actionTypes.ts+++ b/react/features/base/conference/actionTypes.ts@@ -138,6 +138,18 @@ export const CONFERENCE_WILL_LEAVE = 'CONFERENCE_WILL_LEAVE';*/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 conference.diff --git a/react/features/base/conference/actions.ts b/react/features/base/conference/actions.tsindex 36770f9a86..aca2eb747e 100644--- a/react/features/base/conference/actions.ts+++ b/react/features/base/conference/actions.ts@@ -41,6 +41,7 @@ import {CONFERENCE_UNIQUE_ID_SET,CONFERENCE_WILL_JOIN,CONFERENCE_WILL_LEAVE,+ DATA_CHANNEL_CLOSED,DATA_CHANNEL_OPENED,E2E_RTT_CHANGED,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.*diff --git a/react/features/external-api/middleware.ts b/react/features/external-api/middleware.tsindex 68eb0826f1..c058a286d2 100644--- a/react/features/external-api/middleware.ts+++ b/react/features/external-api/middleware.ts@@ -3,6 +3,7 @@ import { getJitsiMeetTransport } from '../../../modules/transport';import {CONFERENCE_FAILED,CONFERENCE_JOINED,+ DATA_CHANNEL_CLOSED,DATA_CHANNEL_OPENED,KICKED_OUT} from '../base/conference/actionTypes';@@ -124,6 +125,10 @@ MiddlewareRegistry.register(store => next => action => {break;}+ case DATA_CHANNEL_CLOSED:+ APP.API.notifyDataChannelClosed(action.code, action.reason);+ break;+case DATA_CHANNEL_OPENED:APP.API.notifyDataChannelOpened();break;diff --git a/react/features/notifications/constants.ts b/react/features/notifications/constants.tsindex bb05e037a3..6998ca5937 100644--- a/react/features/notifications/constants.ts+++ b/react/features/notifications/constants.ts@@ -56,6 +56,13 @@ export const NOTIFICATION_ICON = {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.*