瀏覽代碼

fix(ice-failed): initial ICE failure

Switches from using JitsiConference.isJvbConnectionInterrupted
flag to peerconnection's ICE state. The interrupted
flag is not set if the connection fails initially.
dev1
paweldomas 5 年之前
父節點
當前提交
80d8cc952c
共有 2 個文件被更改,包括 10 次插入8 次删除
  1. 9
    7
      modules/connectivity/IceFailedNotification.js
  2. 1
    1
      modules/xmpp/JingleSessionPC.js

+ 9
- 7
modules/connectivity/IceFailedNotification.js 查看文件

@@ -35,17 +35,19 @@ export default class IceFailedNotification {
35 35
                     return;
36 36
                 }
37 37
 
38
-                if (this._conference.isJvbConnectionInterrupted) {
38
+                const jvbConnection = this._conference.jvbJingleSession;
39
+                const jvbConnIceState = jvbConnection && jvbConnection.getIceConnectionState();
40
+
41
+                if (!jvbConnection) {
42
+                    logger.warn('Not sending ICE failed - no JVB connection');
43
+                } else if (jvbConnIceState === 'connected') {
44
+                    logger.info('ICE connection restored - not sending ICE failed');
45
+                } else {
39 46
                     this._iceFailedTimeout = window.setTimeout(() => {
40
-                        logger.info(
41
-                            'Sending ICE failed'
42
-                            + ' - the connection has not recovered');
47
+                        logger.info(`Sending ICE failed - the connection has not recovered: ${jvbConnIceState}`);
43 48
                         this._iceFailedTimeout = undefined;
44 49
                         session.sendIceFailedNotification();
45 50
                     }, 2000);
46
-                } else {
47
-                    logger.info(
48
-                        'ICE connection restored - not sending ICE failed');
49 51
                 }
50 52
             },
51 53
             error => {

+ 1
- 1
modules/xmpp/JingleSessionPC.js 查看文件

@@ -2336,7 +2336,7 @@ export default class JingleSessionPC extends JingleSession {
2336 2336
      * @returns the ice connection state for the peer connection.
2337 2337
      */
2338 2338
     getIceConnectionState() {
2339
-        return this.peerconnection.iceConnectionState;
2339
+        return this.peerconnection.getConnectionState();
2340 2340
     }
2341 2341
 
2342 2342
     /**

Loading…
取消
儲存