Close more properly local streams.

This commit is contained in:
Pierre HUBERT 2019-01-26 11:53:43 +01:00
parent a46a7154ea
commit 982c40788c

View File

@ -488,6 +488,12 @@ ComunicWeb.components.calls.callWindow = {
*/ */
var interval = setInterval(function(){ var interval = setInterval(function(){
//Check if call is not visible anymore
if(!callContainer.isConnected){
call.close();
return;
}
if(!call.open) if(!call.open)
return clearInterval(interval); 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 //Notify server
ComunicWeb.components.calls.interface.hangUp(call.info.id, function(){}); ComunicWeb.components.calls.interface.hangUp(call.info.id, function(){});
} }