|
@@ -1,11 +1,11 @@
|
1
|
1
|
/* global __filename, module, require */
|
2
|
|
-var logger = require("jitsi-meet-logger").getLogger(__filename);
|
3
|
|
-var MediaType = require("../../service/RTC/MediaType");
|
4
|
|
-var RTCBrowserType = require("../RTC/RTCBrowserType");
|
5
|
|
-var RTCEvents = require("../../service/RTC/RTCEvents");
|
|
2
|
+var logger = require('jitsi-meet-logger').getLogger(__filename);
|
|
3
|
+var MediaType = require('../../service/RTC/MediaType');
|
|
4
|
+var RTCBrowserType = require('../RTC/RTCBrowserType');
|
|
5
|
+var RTCEvents = require('../../service/RTC/RTCEvents');
|
6
|
6
|
|
7
|
|
-import * as JitsiConferenceEvents from "../../JitsiConferenceEvents";
|
8
|
|
-import * as JitsiTrackEvents from "../../JitsiTrackEvents";
|
|
7
|
+import * as JitsiConferenceEvents from '../../JitsiConferenceEvents';
|
|
8
|
+import * as JitsiTrackEvents from '../../JitsiTrackEvents';
|
9
|
9
|
|
10
|
10
|
/**
|
11
|
11
|
* How long we're going to wait after the RTC video track muted event for
|
|
@@ -132,7 +132,7 @@ ParticipantConnectionStatus.prototype.onEndpointConnStatusChanged
|
132
|
132
|
|
133
|
133
|
logger.debug(
|
134
|
134
|
'Detector RTCEvents.ENDPOINT_CONN_STATUS_CHANGED('
|
135
|
|
- + Date.now() +'): ' + endpointId + ": " + isActive);
|
|
135
|
+ + Date.now() +'): ' + endpointId + ': ' + isActive);
|
136
|
136
|
|
137
|
137
|
// Filter out events for the local JID for now
|
138
|
138
|
if (endpointId !== this.conference.myUserId()) {
|
|
@@ -144,8 +144,8 @@ ParticipantConnectionStatus.prototype.onEndpointConnStatusChanged
|
144
|
144
|
&& hasRtcMutedVideoTrack(participant)
|
145
|
145
|
&& !participant.isVideoMuted()) {
|
146
|
146
|
logger.debug(
|
147
|
|
- "Ignoring RTCEvents.ENDPOINT_CONN_STATUS_CHANGED -"
|
148
|
|
- + " will wait for unmute event");
|
|
147
|
+ 'Ignoring RTCEvents.ENDPOINT_CONN_STATUS_CHANGED -'
|
|
148
|
+ + ' will wait for unmute event');
|
149
|
149
|
} else {
|
150
|
150
|
this._changeConnectionStatus(endpointId, isActive);
|
151
|
151
|
}
|
|
@@ -201,7 +201,7 @@ ParticipantConnectionStatus.prototype.onRemoteTrackAdded
|
201
|
201
|
if (!remoteTrack.isLocal() && remoteTrack.getType() === MediaType.VIDEO) {
|
202
|
202
|
|
203
|
203
|
logger.debug(
|
204
|
|
- "Detector on remote track added: ", remoteTrack.getParticipantId());
|
|
204
|
+ 'Detector on remote track added: ', remoteTrack.getParticipantId());
|
205
|
205
|
|
206
|
206
|
remoteTrack.on(
|
207
|
207
|
JitsiTrackEvents.TRACK_MUTE_CHANGED,
|
|
@@ -220,7 +220,7 @@ ParticipantConnectionStatus.prototype.onRemoteTrackRemoved
|
220
|
220
|
= function(remoteTrack) {
|
221
|
221
|
if (!remoteTrack.isLocal() && remoteTrack.getType() === MediaType.VIDEO) {
|
222
|
222
|
logger.debug(
|
223
|
|
- "Detector on remote track removed: ",
|
|
223
|
+ 'Detector on remote track removed: ',
|
224
|
224
|
remoteTrack.getParticipantId());
|
225
|
225
|
remoteTrack.off(
|
226
|
226
|
JitsiTrackEvents.TRACK_MUTE_CHANGED,
|
|
@@ -238,9 +238,9 @@ ParticipantConnectionStatus.prototype.onRemoteTrackRemoved
|
238
|
238
|
ParticipantConnectionStatus.prototype.onTrackRtcMuted = function(track) {
|
239
|
239
|
var participantId = track.getParticipantId();
|
240
|
240
|
var participant = this.conference.getParticipantById(participantId);
|
241
|
|
- logger.debug("Detector track RTC muted: ", participantId);
|
|
241
|
+ logger.debug('Detector track RTC muted: ', participantId);
|
242
|
242
|
if (!participant) {
|
243
|
|
- logger.error("No participant for id: " + participantId);
|
|
243
|
+ logger.error('No participant for id: ' + participantId);
|
244
|
244
|
return;
|
245
|
245
|
}
|
246
|
246
|
if (!participant.isVideoMuted()) {
|
|
@@ -249,7 +249,7 @@ ParticipantConnectionStatus.prototype.onTrackRtcMuted = function(track) {
|
249
|
249
|
this.trackTimers[participantId] = window.setTimeout(function () {
|
250
|
250
|
if (!track.isMuted() && participant.isConnectionActive()) {
|
251
|
251
|
logger.info(
|
252
|
|
- "Connection interrupted through the RTC mute: "
|
|
252
|
+ 'Connection interrupted through the RTC mute: '
|
253
|
253
|
+ participantId, Date.now());
|
254
|
254
|
this._changeConnectionStatus(participantId, false);
|
255
|
255
|
}
|
|
@@ -265,13 +265,13 @@ ParticipantConnectionStatus.prototype.onTrackRtcMuted = function(track) {
|
265
|
265
|
* will be processed.
|
266
|
266
|
*/
|
267
|
267
|
ParticipantConnectionStatus.prototype.onTrackRtcUnmuted = function(track) {
|
268
|
|
- logger.debug("Detector track RTC unmuted: ", track);
|
|
268
|
+ logger.debug('Detector track RTC unmuted: ', track);
|
269
|
269
|
var participantId = track.getParticipantId();
|
270
|
270
|
if (!track.isMuted() &&
|
271
|
271
|
!this.conference.getParticipantById(participantId)
|
272
|
272
|
.isConnectionActive()) {
|
273
|
273
|
logger.info(
|
274
|
|
- "Detector connection restored through the RTC unmute: "
|
|
274
|
+ 'Detector connection restored through the RTC unmute: '
|
275
|
275
|
+ participantId, Date.now());
|
276
|
276
|
this._changeConnectionStatus(participantId, true);
|
277
|
277
|
}
|
|
@@ -287,18 +287,18 @@ ParticipantConnectionStatus.prototype.onTrackRtcUnmuted = function(track) {
|
287
|
287
|
ParticipantConnectionStatus.prototype.onSignallingMuteChanged
|
288
|
288
|
= function (track) {
|
289
|
289
|
logger.debug(
|
290
|
|
- "Detector on track signalling mute changed: ", track, track.isMuted());
|
|
290
|
+ 'Detector on track signalling mute changed: ', track, track.isMuted());
|
291
|
291
|
var isMuted = track.isMuted();
|
292
|
292
|
var participantId = track.getParticipantId();
|
293
|
293
|
var participant = this.conference.getParticipantById(participantId);
|
294
|
294
|
if (!participant) {
|
295
|
|
- logger.error("No participant for id: " + participantId);
|
|
295
|
+ logger.error('No participant for id: ' + participantId);
|
296
|
296
|
return;
|
297
|
297
|
}
|
298
|
298
|
var isConnectionActive = participant.isConnectionActive();
|
299
|
299
|
if (isMuted && isConnectionActive && this.trackTimers[participantId]) {
|
300
|
300
|
logger.debug(
|
301
|
|
- "Signalling got in sync - cancelling task for: " + participantId);
|
|
301
|
+ 'Signalling got in sync - cancelling task for: ' + participantId);
|
302
|
302
|
this.clearTimeout(participantId);
|
303
|
303
|
}
|
304
|
304
|
};
|