浏览代码

fix(connectionstatus) Increase the rtc mute timeout for p2p.

Increase the RTC mute timeout from 500ms to 2500ms for p2p connections. This fixes an issue with Chrome tab sharing where the application keeps switching between the avatar and the share contnuously because of a chrome bug https://bugs.chromium.org/p/chromium/issues/detail?id=1258034
dev1
Jaya Allamsetty 4 年前
父节点
当前提交
17aa19ed5b
共有 2 个文件被更改,包括 24 次插入9 次删除
  1. 3
    4
      JitsiConference.js
  2. 21
    5
      modules/connectivity/ParticipantConnectionStatus.js

+ 3
- 4
JitsiConference.js 查看文件

397
             this.rtc,
397
             this.rtc,
398
             this,
398
             this,
399
             {
399
             {
400
-                // Both these options are not public API, leaving it here only
401
-                // as an entry point through config for tuning up purposes.
402
-                // Default values should be adjusted as soon as optimal values
403
-                // are discovered.
400
+                // These options are not public API, leaving it here only as an entry point through config for tuning
401
+                // up purposes. Default values should be adjusted as soon as optimal values are discovered.
402
+                p2pRtcMuteTimeout: config._p2pConnStatusRtcMuteTimeout,
404
                 rtcMuteTimeout: config._peerConnStatusRtcMuteTimeout,
403
                 rtcMuteTimeout: config._peerConnStatusRtcMuteTimeout,
405
                 outOfLastNTimeout: config._peerConnStatusOutOfLastNTimeout
404
                 outOfLastNTimeout: config._peerConnStatusOutOfLastNTimeout
406
             });
405
             });

+ 21
- 5
modules/connectivity/ParticipantConnectionStatus.js 查看文件

12
 const logger = getLogger(__filename);
12
 const logger = getLogger(__filename);
13
 
13
 
14
 /**
14
 /**
15
- * Default value of 500 milliseconds for
16
- * {@link ParticipantConnectionStatus.outOfLastNTimeout}.
15
+ * Default value of 500 milliseconds for {@link ParticipantConnectionStatus.outOfLastNTimeout}.
17
  *
16
  *
18
  * @type {number}
17
  * @type {number}
19
  */
18
  */
20
 const DEFAULT_NOT_IN_LAST_N_TIMEOUT = 500;
19
 const DEFAULT_NOT_IN_LAST_N_TIMEOUT = 500;
21
 
20
 
22
 /**
21
 /**
23
- * Default value of 2000 milliseconds for
24
- * {@link ParticipantConnectionStatus.rtcMuteTimeout}.
22
+ * Default value of 2500 milliseconds for {@link ParticipantConnectionStatus.p2pRtcMuteTimeout}.
23
+ */
24
+const DEFAULT_P2P_RTC_MUTE_TIMEOUT = 2500;
25
+
26
+/**
27
+ * Default value of 10000 milliseconds for {@link ParticipantConnectionStatus.rtcMuteTimeout}.
25
  *
28
  *
26
  * @type {number}
29
  * @type {number}
27
  */
30
  */
170
      * @param {RTC} rtc the RTC service instance
173
      * @param {RTC} rtc the RTC service instance
171
      * @param {JitsiConference} conference parent conference instance
174
      * @param {JitsiConference} conference parent conference instance
172
      * @param {Object} options
175
      * @param {Object} options
176
+     * @param {number} [options.p2pRtcMuteTimeout=2500] custom value for
177
+     * {@link ParticipantConnectionStatus.p2pRtcMuteTimeout}.
173
      * @param {number} [options.rtcMuteTimeout=2000] custom value for
178
      * @param {number} [options.rtcMuteTimeout=2000] custom value for
174
      * {@link ParticipantConnectionStatus.rtcMuteTimeout}.
179
      * {@link ParticipantConnectionStatus.rtcMuteTimeout}.
175
      * @param {number} [options.outOfLastNTimeout=500] custom value for
180
      * @param {number} [options.outOfLastNTimeout=500] custom value for
210
             = typeof options.outOfLastNTimeout === 'number'
215
             = typeof options.outOfLastNTimeout === 'number'
211
                 ? options.outOfLastNTimeout : DEFAULT_NOT_IN_LAST_N_TIMEOUT;
216
                 ? options.outOfLastNTimeout : DEFAULT_NOT_IN_LAST_N_TIMEOUT;
212
 
217
 
218
+        /**
219
+         * How long we are going to wait for the corresponding signaling mute event after the RTC video track muted
220
+         * event is fired on the Media stream, before the connection interrupted is fired. The default value is
221
+         * {@link DEFAULT_P2P_RTC_MUTE_TIMEOUT}.
222
+         *
223
+         * @type {number} amount of time in milliseconds.
224
+         */
225
+        this.p2pRtcMuteTimeout = typeof options.p2pRtcMuteTimeout === 'number'
226
+            ? options.p2pRtcMuteTimeout : DEFAULT_P2P_RTC_MUTE_TIMEOUT;
227
+
213
         /**
228
         /**
214
          * How long we're going to wait after the RTC video track muted event
229
          * How long we're going to wait after the RTC video track muted event
215
          * for the corresponding signalling mute event, before the connection
230
          * for the corresponding signalling mute event, before the connection
285
      */
300
      */
286
     _getVideoFrozenTimeout(id) {
301
     _getVideoFrozenTimeout(id) {
287
         return this.rtc.isInLastN(id)
302
         return this.rtc.isInLastN(id)
288
-            ? this.rtcMuteTimeout : this.outOfLastNTimeout;
303
+            ? this.rtcMuteTimeout
304
+            : this.conference.isP2PActive() ? this.p2pRtcMuteTimeout : this.outOfLastNTimeout;
289
     }
305
     }
290
 
306
 
291
     /**
307
     /**

正在加载...
取消
保存