diff --git a/assets/js/components/calls/callWindow.js b/assets/js/components/calls/callWindow.js index 0c0444d3..39ccb1a3 100644 --- a/assets/js/components/calls/callWindow.js +++ b/assets/js/components/calls/callWindow.js @@ -488,6 +488,12 @@ ComunicWeb.components.calls.callWindow = { */ var interval = setInterval(function(){ + //Check if call is not visible anymore + if(!callContainer.isConnected){ + call.close(); + return; + } + if(!call.open) return clearInterval(interval); @@ -811,6 +817,13 @@ ComunicWeb.components.calls.callWindow = { } } + //Close local stream + if(call.localStream){ + call.localStream.getTracks().forEach(function(track){ + track.stop(); + }); + } + //Notify server ComunicWeb.components.calls.interface.hangUp(call.info.id, function(){}); }