From 982c40788c51f6face384cd4f7bae5b9dcf5ca5e Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 26 Jan 2019 11:53:43 +0100 Subject: [PATCH] Close more properly local streams. --- assets/js/components/calls/callWindow.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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(){}); }