Просмотр исходного кода

style(ParticipantConnectionStatus): adjust indentation

dev1
paweldomas 9 лет назад
Родитель
Сommit
91d19aca8e
1 измененных файлов: 273 добавлений и 258 удалений
  1. 273
    258
      modules/connectivity/ParticipantConnectionStatus.js

+ 273
- 258
modules/connectivity/ParticipantConnectionStatus.js Просмотреть файл

@@ -21,298 +21,313 @@ const DEFAULT_RTC_MUTE_TIMEOUT = 2000;
21 21
  * JitsiConferenceEvents.PARTICIPANT_CONN_STATUS_CHANGED events.
22 22
  */
23 23
 export default class ParticipantConnectionStatus {
24
-
25
-/**
26
- * Creates new instance of <tt>ParticipantConnectionStatus</tt>.
27
- *
28
- * @constructor
29
- * @param {RTC} rtc the RTC service instance
30
- * @param {JitsiConference} conference parent conference instance
31
- * @param {number} rtcMuteTimeout (optional) custom value for
32
- * {@link ParticipantConnectionStatus.rtcMuteTimeout}.
33
- */
34
-constructor(rtc, conference, rtcMuteTimeout) {
35
-    this.rtc = rtc;
36
-    this.conference = conference;
37
-    /**
38
-     * A map of the "endpoint ID"(which corresponds to the resource part of MUC
39
-     * JID(nickname)) to the timeout callback IDs scheduled using
40
-     * window.setTimeout.
41
-     * @type {Object.<string, number>}
42
-     */
43
-    this.trackTimers = {};
44 24
     /**
45
-     * How long we're going to wait after the RTC video track muted event for
46
-     * the corresponding signalling mute event, before the connection
47
-     * interrupted is fired. The default value is
48
-     * {@link DEFAULT_RTC_MUTE_TIMEOUT}.
25
+     * Creates new instance of <tt>ParticipantConnectionStatus</tt>.
49 26
      *
50
-     * @type {number} amount of time in milliseconds
27
+     * @constructor
28
+     * @param {RTC} rtc the RTC service instance
29
+     * @param {JitsiConference} conference parent conference instance
30
+     * @param {number} rtcMuteTimeout (optional) custom value for
31
+     * {@link ParticipantConnectionStatus.rtcMuteTimeout}.
51 32
      */
52
-    this.rtcMuteTimeout
53
-        = typeof rtcMuteTimeout === 'number'
54
-            ? rtcMuteTimeout : DEFAULT_RTC_MUTE_TIMEOUT;
55
-    logger.info("RtcMuteTimeout set to: " + this.rtcMuteTimeout);
56
-}
57
-
58
-/**
59
- * Initializes <tt>ParticipantConnectionStatus</tt> and bind required event
60
- * listeners.
61
- */
62
-init() {
63
-
64
-    this._onEndpointConnStatusChanged
65
-        = this.onEndpointConnStatusChanged.bind(this);
66
-
67
-    this.rtc.addListener(
68
-        RTCEvents.ENDPOINT_CONN_STATUS_CHANGED,
69
-        this._onEndpointConnStatusChanged);
33
+    constructor(rtc, conference, rtcMuteTimeout) {
34
+        this.rtc = rtc;
35
+        this.conference = conference;
36
+        /**
37
+         * A map of the "endpoint ID"(which corresponds to the resource part
38
+         * of MUC JID(nickname)) to the timeout callback IDs scheduled using
39
+         * window.setTimeout.
40
+         * @type {Object.<string, number>}
41
+         */
42
+        this.trackTimers = {};
43
+        /**
44
+         * How long we're going to wait after the RTC video track muted event
45
+         * for the corresponding signalling mute event, before the connection
46
+         * interrupted is fired. The default value is
47
+         * {@link DEFAULT_RTC_MUTE_TIMEOUT}.
48
+         *
49
+         * @type {number} amount of time in milliseconds
50
+         */
51
+        this.rtcMuteTimeout
52
+            = typeof rtcMuteTimeout === 'number'
53
+                ? rtcMuteTimeout : DEFAULT_RTC_MUTE_TIMEOUT;
54
+        logger.info("RtcMuteTimeout set to: " + this.rtcMuteTimeout);
55
+    }
70 56
 
71
-    // On some browsers MediaStreamTrack trigger "onmute"/"onunmute"
72
-    // events for video type tracks when they stop receiving data which is
73
-    // often a sign that remote user is having connectivity issues
74
-    if (RTCBrowserType.isVideoMuteOnConnInterruptedSupported()) {
57
+    /**
58
+     * Initializes <tt>ParticipantConnectionStatus</tt> and bind required event
59
+     * listeners.
60
+     */
61
+    init() {
75 62
 
76
-        this._onTrackRtcMuted = this.onTrackRtcMuted.bind(this);
77
-        this.rtc.addListener(
78
-            RTCEvents.REMOTE_TRACK_MUTE, this._onTrackRtcMuted);
63
+        this._onEndpointConnStatusChanged
64
+            = this.onEndpointConnStatusChanged.bind(this);
79 65
 
80
-        this._onTrackRtcUnmuted = this.onTrackRtcUnmuted.bind(this);
81 66
         this.rtc.addListener(
82
-            RTCEvents.REMOTE_TRACK_UNMUTE, this._onTrackRtcUnmuted);
83
-
84
-        // Track added/removed listeners are used to bind "mute"/"unmute"
85
-        // event handlers
86
-        this._onRemoteTrackAdded = this.onRemoteTrackAdded.bind(this);
87
-        this.conference.on(
88
-            JitsiConferenceEvents.TRACK_ADDED, this._onRemoteTrackAdded);
89
-        this._onRemoteTrackRemoved = this.onRemoteTrackRemoved.bind(this);
90
-        this.conference.on(
91
-            JitsiConferenceEvents.TRACK_REMOVED, this._onRemoteTrackRemoved);
92
-
93
-        // Listened which will be bound to JitsiRemoteTrack to listen for
94
-        // signalling mute/unmute events.
95
-        this._onSignallingMuteChanged = this.onSignallingMuteChanged.bind(this);
67
+            RTCEvents.ENDPOINT_CONN_STATUS_CHANGED,
68
+            this._onEndpointConnStatusChanged);
69
+
70
+        // On some browsers MediaStreamTrack trigger "onmute"/"onunmute"
71
+        // events for video type tracks when they stop receiving data which is
72
+        // often a sign that remote user is having connectivity issues
73
+        if (RTCBrowserType.isVideoMuteOnConnInterruptedSupported()) {
74
+
75
+            this._onTrackRtcMuted = this.onTrackRtcMuted.bind(this);
76
+            this.rtc.addListener(
77
+                RTCEvents.REMOTE_TRACK_MUTE, this._onTrackRtcMuted);
78
+
79
+            this._onTrackRtcUnmuted = this.onTrackRtcUnmuted.bind(this);
80
+            this.rtc.addListener(
81
+                RTCEvents.REMOTE_TRACK_UNMUTE, this._onTrackRtcUnmuted);
82
+
83
+            // Track added/removed listeners are used to bind "mute"/"unmute"
84
+            // event handlers
85
+            this._onRemoteTrackAdded = this.onRemoteTrackAdded.bind(this);
86
+            this.conference.on(
87
+                JitsiConferenceEvents.TRACK_ADDED,
88
+                this._onRemoteTrackAdded);
89
+
90
+            this._onRemoteTrackRemoved = this.onRemoteTrackRemoved.bind(this);
91
+            this.conference.on(
92
+                JitsiConferenceEvents.TRACK_REMOVED,
93
+                this._onRemoteTrackRemoved);
94
+
95
+            // Listened which will be bound to JitsiRemoteTrack to listen for
96
+            // signalling mute/unmute events.
97
+            this._onSignallingMuteChanged
98
+                = this.onSignallingMuteChanged.bind(this);
99
+        }
96 100
     }
97
-}
98
-
99
-/**
100
- * Removes all event listeners and disposes of all resources held by this
101
- * instance.
102
- */
103
-dispose() {
104 101
 
105
-    this.rtc.removeListener(
106
-        RTCEvents.ENDPOINT_CONN_STATUS_CHANGED,
107
-        this._onEndpointConnStatusChanged);
102
+    /**
103
+     * Removes all event listeners and disposes of all resources held by this
104
+     * instance.
105
+     */
106
+    dispose() {
108 107
 
109
-    if (RTCBrowserType.isVideoMuteOnConnInterruptedSupported()) {
110
-        this.rtc.removeListener(
111
-            RTCEvents.REMOTE_TRACK_MUTE, this._onTrackRtcMuted);
112 108
         this.rtc.removeListener(
113
-            RTCEvents.REMOTE_TRACK_UNMUTE, this._onTrackRtcUnmuted);
114
-        this.conference.off(
115
-            JitsiConferenceEvents.TRACK_ADDED, this._onRemoteTrackAdded);
116
-        this.conference.off(
117
-            JitsiConferenceEvents.TRACK_REMOVED, this._onRemoteTrackRemoved);
118
-    }
119
-
120
-    Object.keys(this.trackTimers).forEach(function (participantId) {
121
-        this.clearTimeout(participantId);
122
-    }.bind(this));
123
-}
109
+            RTCEvents.ENDPOINT_CONN_STATUS_CHANGED,
110
+            this._onEndpointConnStatusChanged);
111
+
112
+        if (RTCBrowserType.isVideoMuteOnConnInterruptedSupported()) {
113
+            this.rtc.removeListener(
114
+                RTCEvents.REMOTE_TRACK_MUTE,
115
+                this._onTrackRtcMuted);
116
+            this.rtc.removeListener(
117
+                RTCEvents.REMOTE_TRACK_UNMUTE,
118
+                this._onTrackRtcUnmuted);
119
+
120
+            this.conference.off(
121
+                JitsiConferenceEvents.TRACK_ADDED,
122
+                this._onRemoteTrackAdded);
123
+            this.conference.off(
124
+                JitsiConferenceEvents.TRACK_REMOVED,
125
+                this._onRemoteTrackRemoved);
126
+        }
124 127
 
125
-/**
126
- * Handles RTCEvents.ENDPOINT_CONN_STATUS_CHANGED triggered when we receive
127
- * notification over the data channel from the bridge about endpoint's
128
- * connection status update.
129
- * @param endpointId {string} the endpoint ID(MUC nickname/resource JID)
130
- * @param isActive {boolean} true if the connection is OK or false otherwise
131
- */
132
-onEndpointConnStatusChanged(endpointId, isActive) {
128
+        Object.keys(this.trackTimers).forEach(function (participantId) {
129
+            this.clearTimeout(participantId);
130
+        }.bind(this));
131
+    }
133 132
 
134
-    logger.debug(
135
-        'Detector RTCEvents.ENDPOINT_CONN_STATUS_CHANGED('
136
-            + Date.now() +'): ' + endpointId + ': ' + isActive);
133
+    /**
134
+     * Handles RTCEvents.ENDPOINT_CONN_STATUS_CHANGED triggered when we receive
135
+     * notification over the data channel from the bridge about endpoint's
136
+     * connection status update.
137
+     * @param endpointId {string} the endpoint ID(MUC nickname/resource JID)
138
+     * @param isActive {boolean} true if the connection is OK or false otherwise
139
+     */
140
+    onEndpointConnStatusChanged(endpointId, isActive) {
137 141
 
138
-    // Filter out events for the local JID for now
139
-    if (endpointId !== this.conference.myUserId()) {
140
-        var participant = this.conference.getParticipantById(endpointId);
141
-        // Delay the 'active' event until the video track gets RTC unmuted event
142
-        if (isActive
143
-                && RTCBrowserType.isVideoMuteOnConnInterruptedSupported()
144
-                && participant
145
-                && participant.hasAnyVideoTrackWebRTCMuted()
146
-                && !participant.isVideoMuted()) {
147
-            logger.debug(
148
-                'Ignoring RTCEvents.ENDPOINT_CONN_STATUS_CHANGED -'
149
-                    + ' will wait for unmute event');
150
-        } else {
151
-            this._changeConnectionStatus(endpointId, isActive);
142
+        logger.debug(
143
+            'Detector RTCEvents.ENDPOINT_CONN_STATUS_CHANGED('
144
+                + Date.now() +'): ' + endpointId + ': ' + isActive);
145
+
146
+        // Filter out events for the local JID for now
147
+        if (endpointId !== this.conference.myUserId()) {
148
+            var participant = this.conference.getParticipantById(endpointId);
149
+            // Delay the 'active' event until the video track gets
150
+            // the RTC unmuted event
151
+            if (isActive
152
+                    && RTCBrowserType.isVideoMuteOnConnInterruptedSupported()
153
+                    && participant
154
+                    && participant.hasAnyVideoTrackWebRTCMuted()
155
+                    && !participant.isVideoMuted()) {
156
+                logger.debug(
157
+                    'Ignoring RTCEvents.ENDPOINT_CONN_STATUS_CHANGED -'
158
+                        + ' will wait for unmute event');
159
+            } else {
160
+                this._changeConnectionStatus(endpointId, isActive);
161
+            }
152 162
         }
153 163
     }
154
-}
155 164
 
156
-_changeConnectionStatus(endpointId, newStatus) {
157
-    var participant = this.conference.getParticipantById(endpointId);
158
-    if (!participant) {
159
-        // This will happen when participant exits the conference with broken
160
-        // ICE connection and we join after that. The bridge keeps sending
161
-        // that notification until the conference does not expire.
162
-        logger.warn(
163
-            'Missed participant connection status update - ' +
164
-                'no participant for endpoint: ' + endpointId);
165
-        return;
166
-    }
167
-    if (participant.isConnectionActive() !== newStatus) {
165
+    _changeConnectionStatus(endpointId, newStatus) {
166
+        var participant = this.conference.getParticipantById(endpointId);
167
+        if (!participant) {
168
+            // This will happen when participant exits the conference with
169
+            // broken ICE connection and we join after that. The bridge keeps
170
+            // sending that notification until the conference does not expire.
171
+            logger.warn(
172
+                'Missed participant connection status update - ' +
173
+                    'no participant for endpoint: ' + endpointId);
174
+            return;
175
+        }
176
+        if (participant.isConnectionActive() !== newStatus) {
168 177
 
169
-        participant._setIsConnectionActive(newStatus);
178
+            participant._setIsConnectionActive(newStatus);
170 179
 
171
-        logger.debug(
172
-            'Emit endpoint conn status(' + Date.now() + '): ',
173
-            endpointId, newStatus);
174
-
175
-        // Log the event on CallStats
176
-        Statistics.sendLog(
177
-            JSON.stringify({
178
-                id: 'peer.conn.status',
179
-                participant: endpointId,
180
-                status: newStatus
181
-            }));
182
-
183
-        // and analytics
184
-        Statistics.analytics.sendEvent('peer.conn.status',
185
-            {label: newStatus});
186
-
187
-        this.conference.eventEmitter.emit(
188
-            JitsiConferenceEvents.PARTICIPANT_CONN_STATUS_CHANGED,
189
-            endpointId, newStatus);
180
+            logger.debug(
181
+                'Emit endpoint conn status(' + Date.now() + '): ',
182
+                endpointId, newStatus);
183
+
184
+            // Log the event on CallStats
185
+            Statistics.sendLog(
186
+                JSON.stringify({
187
+                    id: 'peer.conn.status',
188
+                    participant: endpointId,
189
+                    status: newStatus
190
+                }));
191
+
192
+            // and analytics
193
+            Statistics.analytics.sendEvent('peer.conn.status',
194
+                {label: newStatus});
195
+
196
+            this.conference.eventEmitter.emit(
197
+                JitsiConferenceEvents.PARTICIPANT_CONN_STATUS_CHANGED,
198
+                endpointId, newStatus);
199
+        }
190 200
     }
191
-}
192 201
 
193
-/**
194
- * Reset the postponed "connection interrupted" event which was previously
195
- * scheduled as a timeout on RTC 'onmute' event.
196
- *
197
- * @param participantId the participant for which the "connection interrupted"
198
- * timeout was scheduled
199
- */
200
-clearTimeout(participantId) {
201
-    if (this.trackTimers[participantId]) {
202
-        window.clearTimeout(this.trackTimers[participantId]);
203
-        this.trackTimers[participantId] = null;
202
+    /**
203
+     * Reset the postponed "connection interrupted" event which was previously
204
+     * scheduled as a timeout on RTC 'onmute' event.
205
+     *
206
+     * @param participantId the participant for which the "connection
207
+     * interrupted" timeout was scheduled
208
+     */
209
+    clearTimeout(participantId) {
210
+        if (this.trackTimers[participantId]) {
211
+            window.clearTimeout(this.trackTimers[participantId]);
212
+            this.trackTimers[participantId] = null;
213
+        }
204 214
     }
205
-}
206 215
 
207
-/**
208
- * Bind signalling mute event listeners for video {JitsiRemoteTrack} when
209
- * a new one is added to the conference.
210
- *
211
- * @param {JitsiTrack} remoteTrack the {JitsiTrack} which is being added to
212
- * the conference.
213
- */
214
-onRemoteTrackAdded(remoteTrack) {
215
-    if (!remoteTrack.isLocal() && remoteTrack.getType() === MediaType.VIDEO) {
216
+    /**
217
+     * Bind signalling mute event listeners for video {JitsiRemoteTrack} when
218
+     * a new one is added to the conference.
219
+     *
220
+     * @param {JitsiTrack} remoteTrack the {JitsiTrack} which is being added to
221
+     * the conference.
222
+     */
223
+    onRemoteTrackAdded(remoteTrack) {
224
+        if (!remoteTrack.isLocal()
225
+                && remoteTrack.getType() === MediaType.VIDEO) {
216 226
 
217
-        logger.debug(
218
-            'Detector on remote track added: ', remoteTrack.getParticipantId());
227
+            logger.debug(
228
+                'Detector on remote track added: ',
229
+                remoteTrack.getParticipantId());
219 230
 
220
-        remoteTrack.on(
221
-            JitsiTrackEvents.TRACK_MUTE_CHANGED,
222
-            this._onSignallingMuteChanged);
231
+            remoteTrack.on(
232
+                JitsiTrackEvents.TRACK_MUTE_CHANGED,
233
+                this._onSignallingMuteChanged);
234
+        }
223 235
     }
224
-}
225 236
 
226
-/**
227
- * Removes all event listeners bound to the remote video track and clears any
228
- * related timeouts.
229
- *
230
- * @param {JitsiRemoteTrack} remoteTrack the remote track which is being removed
231
- * from the conference.
232
- */
233
-onRemoteTrackRemoved(remoteTrack) {
234
-    if (!remoteTrack.isLocal() && remoteTrack.getType() === MediaType.VIDEO) {
235
-        logger.debug(
236
-            'Detector on remote track removed: ',
237
-            remoteTrack.getParticipantId());
238
-        remoteTrack.off(
239
-            JitsiTrackEvents.TRACK_MUTE_CHANGED,
240
-            this._onSignallingMuteChanged);
241
-        this.clearTimeout(remoteTrack.getParticipantId());
237
+    /**
238
+     * Removes all event listeners bound to the remote video track and clears
239
+     * any related timeouts.
240
+     *
241
+     * @param {JitsiRemoteTrack} remoteTrack the remote track which is being
242
+     * removed from the conference.
243
+     */
244
+    onRemoteTrackRemoved(remoteTrack) {
245
+        if (!remoteTrack.isLocal()
246
+                && remoteTrack.getType() === MediaType.VIDEO) {
247
+            logger.debug(
248
+                'Detector on remote track removed: ',
249
+                remoteTrack.getParticipantId());
250
+            remoteTrack.off(
251
+                JitsiTrackEvents.TRACK_MUTE_CHANGED,
252
+                this._onSignallingMuteChanged);
253
+            this.clearTimeout(remoteTrack.getParticipantId());
254
+        }
242 255
     }
243
-}
244 256
 
245
-/**
246
- * Handles RTC 'onmute' event for the video track.
247
- *
248
- * @param {JitsiRemoteTrack} track the video track for which 'onmute' event will
249
- * be processed.
250
- */
251
-onTrackRtcMuted(track) {
252
-    var participantId = track.getParticipantId();
253
-    var participant = this.conference.getParticipantById(participantId);
254
-    logger.debug('Detector track RTC muted: ', participantId);
255
-    if (!participant) {
256
-        logger.error('No participant for id: ' + participantId);
257
-        return;
258
-    }
259
-    if (!participant.isVideoMuted()) {
260
-        // If the user is not muted according to the signalling we'll give it
261
-        // some time, before the connection interrupted event is triggered.
262
-        this.trackTimers[participantId] = window.setTimeout(function () {
263
-            if (!track.isMuted() && participant.isConnectionActive()) {
264
-                logger.info(
265
-                    'Connection interrupted through the RTC mute: '
266
-                        + participantId, Date.now());
267
-                this._changeConnectionStatus(participantId, false);
268
-            }
269
-            this.clearTimeout(participantId);
270
-        }.bind(this), this.rtcMuteTimeout);
257
+    /**
258
+     * Handles RTC 'onmute' event for the video track.
259
+     *
260
+     * @param {JitsiRemoteTrack} track the video track for which 'onmute' event
261
+     * will be processed.
262
+     */
263
+    onTrackRtcMuted(track) {
264
+        var participantId = track.getParticipantId();
265
+        var participant = this.conference.getParticipantById(participantId);
266
+        logger.debug('Detector track RTC muted: ', participantId);
267
+        if (!participant) {
268
+            logger.error('No participant for id: ' + participantId);
269
+            return;
270
+        }
271
+        if (!participant.isVideoMuted()) {
272
+            // If the user is not muted according to the signalling we'll give
273
+            // it some time, before the connection interrupted event is
274
+            // triggered.
275
+            this.trackTimers[participantId] = window.setTimeout(function () {
276
+                if (!track.isMuted() && participant.isConnectionActive()) {
277
+                    logger.info(
278
+                        'Connection interrupted through the RTC mute: '
279
+                            + participantId, Date.now());
280
+                    this._changeConnectionStatus(participantId, false);
281
+                }
282
+                this.clearTimeout(participantId);
283
+            }.bind(this), this.rtcMuteTimeout);
284
+        }
271 285
     }
272
-}
273 286
 
274
-/**
275
- * Handles RTC 'onunmute' event for the video track.
276
- *
277
- * @param {JitsiRemoteTrack} track the video track for which 'onunmute' event
278
- * will be processed.
279
- */
280
-onTrackRtcUnmuted(track) {
281
-    logger.debug('Detector track RTC unmuted: ', track);
282
-    var participantId = track.getParticipantId();
283
-    if (!track.isMuted() &&
284
-        !this.conference.getParticipantById(participantId)
285
-            .isConnectionActive()) {
286
-        logger.info(
287
-            'Detector connection restored through the RTC unmute: '
288
-                + participantId, Date.now());
289
-        this._changeConnectionStatus(participantId, true);
287
+    /**
288
+     * Handles RTC 'onunmute' event for the video track.
289
+     *
290
+     * @param {JitsiRemoteTrack} track the video track for which 'onunmute'
291
+     * event will be processed.
292
+     */
293
+    onTrackRtcUnmuted(track) {
294
+        logger.debug('Detector track RTC unmuted: ', track);
295
+        var participantId = track.getParticipantId();
296
+        if (!track.isMuted() &&
297
+            !this.conference.getParticipantById(participantId)
298
+                .isConnectionActive()) {
299
+            logger.info(
300
+                'Detector connection restored through the RTC unmute: '
301
+                    + participantId, Date.now());
302
+            this._changeConnectionStatus(participantId, true);
303
+        }
304
+        this.clearTimeout(participantId);
290 305
     }
291
-    this.clearTimeout(participantId);
292
-}
293 306
 
294
-/**
295
- * Here the signalling "mute"/"unmute" events are processed.
296
- *
297
- * @param {JitsiRemoteTrack} track the remote video track for which
298
- * the signalling mute/unmute event will be processed.
299
- */
300
-onSignallingMuteChanged (track) {
301
-    logger.debug(
302
-        'Detector on track signalling mute changed: ', track, track.isMuted());
303
-    var isMuted = track.isMuted();
304
-    var participantId = track.getParticipantId();
305
-    var participant = this.conference.getParticipantById(participantId);
306
-    if (!participant) {
307
-        logger.error('No participant for id: ' + participantId);
308
-        return;
309
-    }
310
-    var isConnectionActive = participant.isConnectionActive();
311
-    if (isMuted && isConnectionActive && this.trackTimers[participantId]) {
307
+    /**
308
+     * Here the signalling "mute"/"unmute" events are processed.
309
+     *
310
+     * @param {JitsiRemoteTrack} track the remote video track for which
311
+     * the signalling mute/unmute event will be processed.
312
+     */
313
+    onSignallingMuteChanged (track) {
312 314
         logger.debug(
313
-            'Signalling got in sync - cancelling task for: ' + participantId);
314
-        this.clearTimeout(participantId);
315
+            'Detector on track signalling mute changed: ',
316
+            track, track.isMuted());
317
+        var isMuted = track.isMuted();
318
+        var participantId = track.getParticipantId();
319
+        var participant = this.conference.getParticipantById(participantId);
320
+        if (!participant) {
321
+            logger.error('No participant for id: ' + participantId);
322
+            return;
323
+        }
324
+        var isConnectionActive = participant.isConnectionActive();
325
+        if (isMuted && isConnectionActive && this.trackTimers[participantId]) {
326
+            logger.debug(
327
+                'Signalling got in sync - cancelling task for: '
328
+                    + participantId);
329
+            this.clearTimeout(participantId);
330
+        }
315 331
     }
316
-}
317 332
 
318 333
 }

Загрузка…
Отмена
Сохранить