From 05a5b1b4bf6f1d657c3667e20b9fcf1dc989f11d Mon Sep 17 00:00:00 2001 From: Simon Eisenmann Date: Thu, 9 Jul 2015 10:07:20 +0200 Subject: [PATCH] Disable joined and left sound when in a call. --- static/js/controllers/uicontroller.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/static/js/controllers/uicontroller.js b/static/js/controllers/uicontroller.js index 4a38d6a6..9693366e 100644 --- a/static/js/controllers/uicontroller.js +++ b/static/js/controllers/uicontroller.js @@ -231,6 +231,19 @@ define(['jquery', 'underscore', 'bigscreen', 'moment', 'sjcl', 'modernizr', 'web mediaStream.webrtc.setAudioMute(cameraMute); }); + $scope.$watch("peer", function(c, o) { + // Watch for peer and disable some sounds while there is a peer. + if (c && !o) { + // New call. + playSound.disable("joined"); + playSound.disable("left"); + } else if (!c && o) { + // No longer in call. + playSound.disable("joined", false); + playSound.disable("left", false); + } + }); + var ringer = playSound.interval("ring", null, 4000); var dialer = playSound.interval("dial", null, 4000); var dialerEnabled = false;