Переглянути джерело

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

+ 3
- 4
JitsiConference.js Переглянути файл

@@ -397,10 +397,9 @@ JitsiConference.prototype._init = function(options = {}) {
397 397
             this.rtc,
398 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 403
                 rtcMuteTimeout: config._peerConnStatusRtcMuteTimeout,
405 404
                 outOfLastNTimeout: config._peerConnStatusOutOfLastNTimeout
406 405
             });

+ 21
- 5
modules/connectivity/ParticipantConnectionStatus.js Переглянути файл

@@ -12,16 +12,19 @@ import Statistics from '../statistics/statistics';
12 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 17
  * @type {number}
19 18
  */
20 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 29
  * @type {number}
27 30
  */
@@ -170,6 +173,8 @@ export default class ParticipantConnectionStatusHandler {
170 173
      * @param {RTC} rtc the RTC service instance
171 174
      * @param {JitsiConference} conference parent conference instance
172 175
      * @param {Object} options
176
+     * @param {number} [options.p2pRtcMuteTimeout=2500] custom value for
177
+     * {@link ParticipantConnectionStatus.p2pRtcMuteTimeout}.
173 178
      * @param {number} [options.rtcMuteTimeout=2000] custom value for
174 179
      * {@link ParticipantConnectionStatus.rtcMuteTimeout}.
175 180
      * @param {number} [options.outOfLastNTimeout=500] custom value for
@@ -210,6 +215,16 @@ export default class ParticipantConnectionStatusHandler {
210 215
             = typeof options.outOfLastNTimeout === 'number'
211 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 229
          * How long we're going to wait after the RTC video track muted event
215 230
          * for the corresponding signalling mute event, before the connection
@@ -285,7 +300,8 @@ export default class ParticipantConnectionStatusHandler {
285 300
      */
286 301
     _getVideoFrozenTimeout(id) {
287 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
     /**

Завантаження…
Відмінити
Зберегти