|
@@ -331,13 +331,11 @@ var VideoLayout = {
|
331
|
331
|
|
332
|
332
|
remoteVideo.addRemoteStreamElement(stream);
|
333
|
333
|
|
334
|
|
- // if track is muted make sure we reflect that
|
335
|
|
- if(stream.isMuted())
|
336
|
|
- {
|
337
|
|
- if(stream.getType() === "audio")
|
338
|
|
- this.onAudioMute(stream.getParticipantId(), true);
|
339
|
|
- else
|
340
|
|
- this.onVideoMute(stream.getParticipantId(), true);
|
|
334
|
+ // Make sure track's muted state is reflected
|
|
335
|
+ if (stream.getType() === "audio") {
|
|
336
|
+ this.onAudioMute(stream.getParticipantId(), stream.isMuted());
|
|
337
|
+ } else {
|
|
338
|
+ this.onVideoMute(stream.getParticipantId(), stream.isMuted());
|
341
|
339
|
}
|
342
|
340
|
},
|
343
|
341
|
|
|
@@ -348,6 +346,30 @@ var VideoLayout = {
|
348
|
346
|
if (remoteVideo) {
|
349
|
347
|
remoteVideo.removeRemoteStreamElement(stream);
|
350
|
348
|
}
|
|
349
|
+ this.updateMutedForNoTracks(id, stream.getType());
|
|
350
|
+ },
|
|
351
|
+
|
|
352
|
+ /**
|
|
353
|
+ * FIXME get rid of this method once muted indicator are reactified (by
|
|
354
|
+ * making sure that user with no tracks is displayed as muted )
|
|
355
|
+ *
|
|
356
|
+ * If participant has no tracks will make the UI display muted status.
|
|
357
|
+ * @param {string} participantId
|
|
358
|
+ * @param {string} mediaType 'audio' or 'video'
|
|
359
|
+ */
|
|
360
|
+ updateMutedForNoTracks(participantId, mediaType) {
|
|
361
|
+ const participant = APP.conference.getParticipantById(participantId);
|
|
362
|
+
|
|
363
|
+ if (participant
|
|
364
|
+ && !participant.getTracksByMediaType(mediaType).length) {
|
|
365
|
+ if (mediaType === 'audio') {
|
|
366
|
+ APP.UI.setAudioMuted(participantId, true);
|
|
367
|
+ } else if (mediaType === 'video') {
|
|
368
|
+ APP.UI.setVideoMuted(participantId, true);
|
|
369
|
+ } else {
|
|
370
|
+ logger.error(`Unsupported media type: ${mediaType}`);
|
|
371
|
+ }
|
|
372
|
+ }
|
351
|
373
|
},
|
352
|
374
|
|
353
|
375
|
/**
|
|
@@ -441,6 +463,9 @@ var VideoLayout = {
|
441
|
463
|
this._setRemoteControlProperties(user, remoteVideo);
|
442
|
464
|
this.addRemoteVideoContainer(id, remoteVideo);
|
443
|
465
|
|
|
466
|
+ this.updateMutedForNoTracks(id, 'audio');
|
|
467
|
+ this.updateMutedForNoTracks(id, 'video');
|
|
468
|
+
|
444
|
469
|
const remoteVideosCount = Object.keys(remoteVideos).length;
|
445
|
470
|
|
446
|
471
|
if (remoteVideosCount === 1) {
|