Quellcode durchsuchen

feat(ParticipantConnectionStatus): add RTC mute timeout config

The timeout will be configurable though
'peerDisconnectedThroughRtcTimeout' conference config option. It has
not been document in the public API on purpose.
dev1
paweldomas vor 9 Jahren
Ursprung
Commit
eb204558b2
2 geänderte Dateien mit 23 neuen und 8 gelöschten Zeilen
  1. 3
    1
      JitsiConference.js
  2. 20
    7
      modules/connectivity/ParticipantConnectionStatus.js

+ 3
- 1
JitsiConference.js Datei anzeigen

95
     }
95
     }
96
 
96
 
97
     this.participantConnectionStatus
97
     this.participantConnectionStatus
98
-        = new ParticipantConnectionStatus(this.rtc, this);
98
+        = new ParticipantConnectionStatus(
99
+                this.rtc, this,
100
+                options.config.peerDisconnectedThroughRtcTimeout);
99
     this.participantConnectionStatus.init();
101
     this.participantConnectionStatus.init();
100
 
102
 
101
     if(!this.statistics) {
103
     if(!this.statistics) {

+ 20
- 7
modules/connectivity/ParticipantConnectionStatus.js Datei anzeigen

8
 import * as JitsiTrackEvents from '../../JitsiTrackEvents';
8
 import * as JitsiTrackEvents from '../../JitsiTrackEvents';
9
 
9
 
10
 /**
10
 /**
11
- * How long we're going to wait after the RTC video track muted event for
12
- * the corresponding signalling mute event, before the connection interrupted
13
- * is fired.
11
+ * Default value of 1000 milliseconds for
12
+ * {@link ParticipantConnectionStatus.rtcMuteTimeout}.
14
  *
13
  *
15
- * @type {number} amount of time in milliseconds
14
+ * @type {number}
16
  */
15
  */
17
-const RTC_MUTE_TIMEOUT = 1000;
16
+const DEFAULT_RTC_MUTE_TIMEOUT = 1000;
18
 
17
 
19
 /**
18
 /**
20
  * Class is responsible for emitting
19
  * Class is responsible for emitting
23
  * @constructor
22
  * @constructor
24
  * @param {RTC} rtc the RTC service instance
23
  * @param {RTC} rtc the RTC service instance
25
  * @param {JitsiConference} conference parent conference instance
24
  * @param {JitsiConference} conference parent conference instance
25
+ * @param {number} rtcMuteTimeout (optional) custom value for
26
+ * {@link ParticipantConnectionStatus.rtcMuteTimeout}.
26
  */
27
  */
27
-function ParticipantConnectionStatus(rtc, conference) {
28
+function ParticipantConnectionStatus(rtc, conference, rtcMuteTimeout) {
28
     this.rtc = rtc;
29
     this.rtc = rtc;
29
     this.conference = conference;
30
     this.conference = conference;
30
     /**
31
     /**
34
      * @type {Object.<string, number>}
35
      * @type {Object.<string, number>}
35
      */
36
      */
36
     this.trackTimers = {};
37
     this.trackTimers = {};
38
+    /**
39
+     * How long we're going to wait after the RTC video track muted event for
40
+     * the corresponding signalling mute event, before the connection
41
+     * interrupted is fired. The default value is
42
+     * {@link DEFAULT_RTC_MUTE_TIMEOUT}.
43
+     *
44
+     * @type {number} amount of time in milliseconds
45
+     */
46
+    this.rtcMuteTimeout
47
+        = typeof rtcMuteTimeout === 'number'
48
+            ? rtcMuteTimeout : DEFAULT_RTC_MUTE_TIMEOUT;
49
+    logger.info("RtcMuteTimeout set to: " + this.rtcMuteTimeout);
37
 }
50
 }
38
 
51
 
39
 /**
52
 /**
254
                 this._changeConnectionStatus(participantId, false);
267
                 this._changeConnectionStatus(participantId, false);
255
             }
268
             }
256
             this.clearTimeout(participantId);
269
             this.clearTimeout(participantId);
257
-        }.bind(this), RTC_MUTE_TIMEOUT);
270
+        }.bind(this), this.rtcMuteTimeout);
258
     }
271
     }
259
 };
272
 };
260
 
273
 

Laden…
Abbrechen
Speichern