fix(VideoLayout): muted for no tracks
Will make the UI display audio/video muted icon for remote participants with no audio/video track.
This commit is contained in:
parent
6493b09565
commit
00d3d3c09a
|
@ -486,8 +486,6 @@ export default {
|
||||||
// First try to retrieve both audio and video.
|
// First try to retrieve both audio and video.
|
||||||
let tryCreateLocalTracks;
|
let tryCreateLocalTracks;
|
||||||
|
|
||||||
// FIXME there is no video muted indication visible on the remote side,
|
|
||||||
// after starting in audio only (there's no video track)
|
|
||||||
// FIXME the logic about trying to go audio only on error is duplicated
|
// FIXME the logic about trying to go audio only on error is duplicated
|
||||||
if (options.startAudioOnly) {
|
if (options.startAudioOnly) {
|
||||||
tryCreateLocalTracks
|
tryCreateLocalTracks
|
||||||
|
|
|
@ -331,13 +331,11 @@ var VideoLayout = {
|
||||||
|
|
||||||
remoteVideo.addRemoteStreamElement(stream);
|
remoteVideo.addRemoteStreamElement(stream);
|
||||||
|
|
||||||
// if track is muted make sure we reflect that
|
// Make sure track's muted state is reflected
|
||||||
if(stream.isMuted())
|
if (stream.getType() === "audio") {
|
||||||
{
|
this.onAudioMute(stream.getParticipantId(), stream.isMuted());
|
||||||
if(stream.getType() === "audio")
|
} else {
|
||||||
this.onAudioMute(stream.getParticipantId(), true);
|
this.onVideoMute(stream.getParticipantId(), stream.isMuted());
|
||||||
else
|
|
||||||
this.onVideoMute(stream.getParticipantId(), true);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -348,6 +346,30 @@ var VideoLayout = {
|
||||||
if (remoteVideo) {
|
if (remoteVideo) {
|
||||||
remoteVideo.removeRemoteStreamElement(stream);
|
remoteVideo.removeRemoteStreamElement(stream);
|
||||||
}
|
}
|
||||||
|
this.updateMutedForNoTracks(id, stream.getType());
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FIXME get rid of this method once muted indicator are reactified (by
|
||||||
|
* making sure that user with no tracks is displayed as muted )
|
||||||
|
*
|
||||||
|
* If participant has no tracks will make the UI display muted status.
|
||||||
|
* @param {string} participantId
|
||||||
|
* @param {string} mediaType 'audio' or 'video'
|
||||||
|
*/
|
||||||
|
updateMutedForNoTracks(participantId, mediaType) {
|
||||||
|
const participant = APP.conference.getParticipantById(participantId);
|
||||||
|
|
||||||
|
if (participant
|
||||||
|
&& !participant.getTracksByMediaType(mediaType).length) {
|
||||||
|
if (mediaType === 'audio') {
|
||||||
|
APP.UI.setAudioMuted(participantId, true);
|
||||||
|
} else if (mediaType === 'video') {
|
||||||
|
APP.UI.setVideoMuted(participantId, true);
|
||||||
|
} else {
|
||||||
|
logger.error(`Unsupported media type: ${mediaType}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -441,6 +463,9 @@ var VideoLayout = {
|
||||||
this._setRemoteControlProperties(user, remoteVideo);
|
this._setRemoteControlProperties(user, remoteVideo);
|
||||||
this.addRemoteVideoContainer(id, remoteVideo);
|
this.addRemoteVideoContainer(id, remoteVideo);
|
||||||
|
|
||||||
|
this.updateMutedForNoTracks(id, 'audio');
|
||||||
|
this.updateMutedForNoTracks(id, 'video');
|
||||||
|
|
||||||
const remoteVideosCount = Object.keys(remoteVideos).length;
|
const remoteVideosCount = Object.keys(remoteVideos).length;
|
||||||
|
|
||||||
if (remoteVideosCount === 1) {
|
if (remoteVideosCount === 1) {
|
||||||
|
|
Loading…
Reference in New Issue