Bläddra i källkod

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

Signals that the bridge channel is open. It may take a few ms to get established
after the conference join, so applications might be interested in using it once
ready.
master
Saúl Ibarra Corretgé 3 år sedan
förälder
incheckning
12139655c6

+ 9
- 0
modules/API/API.js Visa fil

@@ -1033,6 +1033,15 @@ class API {
1033 1033
         });
1034 1034
     }
1035 1035
 
1036
+    /**
1037
+     * Notify external application that the data channel has been opened.
1038
+     *
1039
+     * @returns {void}
1040
+     */
1041
+    notifyDataChannelOpened() {
1042
+        this._sendEvent({ name: 'data-channel-opened' });
1043
+    }
1044
+
1036 1045
     /**
1037 1046
      * Notify external application (if API is enabled) that we are ready to be
1038 1047
      * closed.

+ 1
- 0
modules/API/external/external_api.js Visa fil

@@ -80,6 +80,7 @@ const events = {
80 80
     'camera-error': 'cameraError',
81 81
     'chat-updated': 'chatUpdated',
82 82
     'content-sharing-participants-changed': 'contentSharingParticipantsChanged',
83
+    'data-channel-opened': 'dataChannelOpened',
83 84
     'device-list-changed': 'deviceListChanged',
84 85
     'display-name-change': 'displayNameChange',
85 86
     'email-change': 'emailChange',

+ 5
- 0
react/features/external-api/middleware.js Visa fil

@@ -3,6 +3,7 @@
3 3
 import {
4 4
     CONFERENCE_FAILED,
5 5
     CONFERENCE_JOINED,
6
+    DATA_CHANNEL_OPENED,
6 7
     KICKED_OUT
7 8
 } from '../base/conference';
8 9
 import { NOTIFY_CAMERA_ERROR, NOTIFY_MIC_ERROR } from '../base/devices';
@@ -103,6 +104,10 @@ MiddlewareRegistry.register(store => next => action => {
103 104
         break;
104 105
     }
105 106
 
107
+    case DATA_CHANNEL_OPENED:
108
+        APP.API.notifyDataChannelOpened();
109
+        break;
110
+
106 111
     case DOMINANT_SPEAKER_CHANGED:
107 112
         APP.API.notifyDominantSpeakerChanged(action.participant.id);
108 113
         break;

Laddar…
Avbryt
Spara