From 1d660e18837dae2b3161bd794a59f6b79c990a65 Mon Sep 17 00:00:00 2001 From: hristoterezov Date: Tue, 26 May 2015 14:18:45 +0300 Subject: [PATCH] Removes join / leave notifications if the participant start audio muted. --- index.html | 2 +- libs/app.bundle.js | 14 ++++++++++++-- modules/UI/videolayout/VideoLayout.js | 8 ++++++-- modules/members/MemberList.js | 6 ++++++ 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index d967b9387..91a41cf25 100644 --- a/index.html +++ b/index.html @@ -19,7 +19,7 @@ - + diff --git a/libs/app.bundle.js b/libs/app.bundle.js index e8e55bf15..d69a15d2d 100644 --- a/libs/app.bundle.js +++ b/libs/app.bundle.js @@ -7706,7 +7706,9 @@ var VideoLayout = (function (my) { container.id = 'mixedstream'; container.className = 'videocontainer'; remotes.appendChild(container); - UIUtil.playSoundNotification('userJoined'); + if(!config.startAudioMuted || + config.startAudioMuted > APP.members.size()) + UIUtil.playSoundNotification('userJoined'); } if (container) { @@ -8227,7 +8229,9 @@ var VideoLayout = (function (my) { // Remove whole container container.remove(); - UIUtil.playSoundNotification('userLeft'); + if(!config.startAudioMuted || + config.startAudioMuted > APP.members.size()) + UIUtil.playSoundNotification('userLeft'); VideoLayout.resizeThumbnails(); } @@ -10283,6 +10287,12 @@ var Members = { }, removeListener: function (type, listener) { eventEmitter.removeListener(type, listener); + }, + size: function () { + return Object.keys(members).length; + }, + getMembers: function () { + return members; } }; diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.js index 26fc42248..918df36fa 100644 --- a/modules/UI/videolayout/VideoLayout.js +++ b/modules/UI/videolayout/VideoLayout.js @@ -779,7 +779,9 @@ var VideoLayout = (function (my) { container.id = 'mixedstream'; container.className = 'videocontainer'; remotes.appendChild(container); - UIUtil.playSoundNotification('userJoined'); + if(!config.startAudioMuted || + config.startAudioMuted > APP.members.size()) + UIUtil.playSoundNotification('userJoined'); } if (container) { @@ -1300,7 +1302,9 @@ var VideoLayout = (function (my) { // Remove whole container container.remove(); - UIUtil.playSoundNotification('userLeft'); + if(!config.startAudioMuted || + config.startAudioMuted > APP.members.size()) + UIUtil.playSoundNotification('userLeft'); VideoLayout.resizeThumbnails(); } diff --git a/modules/members/MemberList.js b/modules/members/MemberList.js index 343d98f02..73cdab538 100644 --- a/modules/members/MemberList.js +++ b/modules/members/MemberList.js @@ -117,6 +117,12 @@ var Members = { }, removeListener: function (type, listener) { eventEmitter.removeListener(type, listener); + }, + size: function () { + return Object.keys(members).length; + }, + getMembers: function () { + return members; } };