Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(external-api) add data-channel-open event

Saúl Ibarra Corretgé12139655c642
diff --git a/modules/API/API.js b/modules/API/API.js
index e2d4123ffc..e7bc475ef5 100644
--- a/modules/API/API.js
+++ b/modules/API/API.js
@@ -1033,6 +1033,15 @@ class API {
});
}
+ /**
+ * Notify external application that the data channel has been opened.
+ *
+ * @returns {void}
+ */
+ notifyDataChannelOpened() {
+ this._sendEvent({ name: 'data-channel-opened' });
+ }
+
/**
* Notify external application (if API is enabled) that we are ready to be
* closed.
diff --git a/modules/API/external/external_api.js b/modules/API/external/external_api.js
index 4211c97c98..f79b11c6cd 100644
--- a/modules/API/external/external_api.js
+++ b/modules/API/external/external_api.js
@@ -80,6 +80,7 @@ const events = {
'camera-error': 'cameraError',
'chat-updated': 'chatUpdated',
'content-sharing-participants-changed': 'contentSharingParticipantsChanged',
+ 'data-channel-opened': 'dataChannelOpened',
'device-list-changed': 'deviceListChanged',
'display-name-change': 'displayNameChange',
'email-change': 'emailChange',
diff --git a/react/features/external-api/middleware.js b/react/features/external-api/middleware.js
index 6d9ee1cbf5..8560b35df6 100644
--- a/react/features/external-api/middleware.js
+++ b/react/features/external-api/middleware.js
@@ -3,6 +3,7 @@
import {
CONFERENCE_FAILED,
CONFERENCE_JOINED,
+ DATA_CHANNEL_OPENED,
KICKED_OUT
} from '../base/conference';
import { NOTIFY_CAMERA_ERROR, NOTIFY_MIC_ERROR } from '../base/devices';
@@ -103,6 +104,10 @@ MiddlewareRegistry.register(store => next => action => {
break;
}
+ case DATA_CHANNEL_OPENED:
+ APP.API.notifyDataChannelOpened();
+ break;
+
case DOMINANT_SPEAKER_CHANGED:
APP.API.notifyDominantSpeakerChanged(action.participant.id);
break;