Browse Source

fix(BridgeChannel): re-send constraints and videoType message after every re-connect.

This fixes an issue where the receiver constraints and video type messages are sent on the bridge channel only the first time the ws conn gets re-established.
release-8443
Jaya Allamsetty 3 years ago
parent
commit
fa916d41ed
2 changed files with 2 additions and 8 deletions
  1. 1
    7
      modules/RTC/RTC.js
  2. 1
    1
      types/auto/modules/RTC/RTC.d.ts

+ 1
- 7
modules/RTC/RTC.js View File

@@ -195,10 +195,7 @@ export default class RTC extends Listenable {
195 195
         RTCUtils.removeListener(RTCEvents.DEVICE_LIST_CHANGED, this._onDeviceListChanged);
196 196
 
197 197
         if (this._channelOpenListener) {
198
-            this.removeListener(
199
-                RTCEvents.DATA_CHANNEL_OPEN,
200
-                this._channelOpenListener
201
-            );
198
+            this.removeListener(RTCEvents.DATA_CHANNEL_OPEN, this._channelOpenListener);
202 199
         }
203 200
     }
204 201
 
@@ -281,9 +278,6 @@ export default class RTC extends Listenable {
281 278
                     logError(error, 'VideoTypeMessage', this._videoType);
282 279
                 }
283 280
             }
284
-
285
-            this.removeListener(RTCEvents.DATA_CHANNEL_OPEN, this._channelOpenListener);
286
-            this._channelOpenListener = null;
287 281
         };
288 282
         this.addListener(RTCEvents.DATA_CHANNEL_OPEN, this._channelOpenListener);
289 283
 

+ 1
- 1
types/auto/modules/RTC/RTC.d.ts View File

@@ -249,7 +249,7 @@ export default class RTC extends Listenable {
249 249
      * @param {string} [wsUrl] WebSocket URL.
250 250
      */
251 251
     initializeBridgeChannel(peerconnection?: RTCPeerConnection, wsUrl?: string): void;
252
-    _channelOpenListener: any;
252
+    _channelOpenListener: () => void;
253 253
     /**
254 254
      * Receives events when Last N had changed.
255 255
      * @param {array} lastNEndpoints The new Last N endpoints.

Loading…
Cancel
Save