Moves the sound notification code to be played when the participant joins / leaves the room instead of receiving add / remove stream event.

This commit is contained in:
hristoterezov 2015-05-28 14:34:40 +03:00
parent 6eaa3cd45d
commit 01deadf078
4 changed files with 532 additions and 577 deletions

View File

@ -19,7 +19,7 @@
<script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib --> <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
<script src="libs/toastr.js?v=1"></script><!-- notifications lib --> <script src="libs/toastr.js?v=1"></script><!-- notifications lib -->
<script src="interface_config.js?v=5"></script> <script src="interface_config.js?v=5"></script>
<script src="libs/app.bundle.js?v=76"></script> <script src="libs/app.bundle.js?v=77"></script>
<script src="analytics.js?v=1"></script><!-- google analytics plugin --> <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
<link rel="stylesheet" href="css/font.css?v=7"/> <link rel="stylesheet" href="css/font.css?v=7"/>
<link rel="stylesheet" href="css/toastr.css?v=1"> <link rel="stylesheet" href="css/toastr.css?v=1">

File diff suppressed because it is too large Load Diff

View File

@ -458,6 +458,9 @@ function onMucMemberLeft(jid) {
messageHandler.notify(displayName,'notify.somebody', messageHandler.notify(displayName,'notify.somebody',
'disconnected', 'disconnected',
'notify.disconnected'); 'notify.disconnected');
if(!config.startAudioMuted ||
config.startAudioMuted > APP.members.size())
UIUtil.playSoundNotification('userLeft');
// Need to call this with a slight delay, otherwise the element couldn't be // Need to call this with a slight delay, otherwise the element couldn't be
// found for some reason. // found for some reason.
// XXX(gp) it works fine without the timeout for me (with Chrome 38). // XXX(gp) it works fine without the timeout for me (with Chrome 38).
@ -552,6 +555,9 @@ function onMucMemberJoined(jid, id, displayName) {
'connected', 'connected',
'notify.connected'); 'notify.connected');
if(!config.startAudioMuted ||
config.startAudioMuted > APP.members.size())
UIUtil.playSoundNotification('userJoined');
// Add Peer's container // Add Peer's container
VideoLayout.ensurePeerContainerExists(jid,id); VideoLayout.ensurePeerContainerExists(jid,id);
} }

View File

@ -27,12 +27,6 @@ var eventEmitter = null;
*/ */
var focusedVideoInfo = null; var focusedVideoInfo = null;
/**
* Indicates if we have muted our audio before the conference has started.
* @type {boolean}
*/
var preMuted = false;
var mutedAudios = {}; var mutedAudios = {};
var flipXLocalVideo = true; var flipXLocalVideo = true;
@ -779,9 +773,6 @@ var VideoLayout = (function (my) {
container.id = 'mixedstream'; container.id = 'mixedstream';
container.className = 'videocontainer'; container.className = 'videocontainer';
remotes.appendChild(container); remotes.appendChild(container);
if(!config.startAudioMuted ||
config.startAudioMuted > APP.members.size())
UIUtil.playSoundNotification('userJoined');
} }
if (container) { if (container) {
@ -1302,9 +1293,6 @@ var VideoLayout = (function (my) {
// Remove whole container // Remove whole container
container.remove(); container.remove();
if(!config.startAudioMuted ||
config.startAudioMuted > APP.members.size())
UIUtil.playSoundNotification('userLeft');
VideoLayout.resizeThumbnails(); VideoLayout.resizeThumbnails();
} }