From a9eda212e26aeba34732415cd980ef6753005117 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 24 Jun 2014 17:11:15 +0200 Subject: [PATCH] Pause mic and webcam when opening the quitModal dialog Resume in we cancel Dont change previous state (if it was already paused, don't resume) Fix #77 --- public/js/vroom.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/public/js/vroom.js b/public/js/vroom.js index 354afe6..affd585 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -1958,11 +1958,23 @@ function initVroom(room) { // Handle hangup/close window $('#logoutButton').click(function(){ $('#quitModal').modal('show'); + if (!$('#muteMicButton').is(':checked')){ + muteMic(); + } + if (!$('#suspendCamButton').is(':checked')){ + suspendCam(); + } }); // Remove the active class on the logout button if // the modal is closed $('#quitModal').on('hide.bs.modal',function(){ $('#logoutButton').removeClass('active'); + if (!$('#muteMicButton').is(':checked')){ + unmuteMic(); + } + if (!$('#suspendCamButton').is(':checked')){ + resumeCam(); + } }); $('#confirmQuitButton').click(function() { hangupCall;