Makes sure we unmark remote videos as dominant speaker if any when the local participant becomes dominant speaker.

This commit is contained in:
damencho 2016-01-21 11:28:47 -06:00
parent 0db262da6a
commit bc43108877
1 changed files with 13 additions and 4 deletions

View File

@ -540,13 +540,23 @@ var VideoLayout = {
* On dominant speaker changed event.
*/
onDominantSpeakerChanged (id) {
// We ignore local user events.
if (APP.conference.isLocalId(id) || (id === currentDominantSpeaker)) {
if (id === currentDominantSpeaker) {
return;
}
let oldSpeakerRemoteVideo = remoteVideos[currentDominantSpeaker];
// We ignore local user events, but just unmark remote user as dominant
// while we are talking
if (APP.conference.isLocalId(id)) {
if(oldSpeakerRemoteVideo)
{
oldSpeakerRemoteVideo.updateDominantSpeakerIndicator(false);
currentDominantSpeaker = null;
}
return;
}
let remoteVideo = remoteVideos[id];
if (!remoteVideo) {
return;
}
@ -555,7 +565,6 @@ var VideoLayout = {
remoteVideo.updateDominantSpeakerIndicator(true);
// let's remove the indications from the remote video if any
let oldSpeakerRemoteVideo = remoteVideos[currentDominantSpeaker];
if (oldSpeakerRemoteVideo) {
oldSpeakerRemoteVideo.updateDominantSpeakerIndicator(false);
}