Add support for call closed event

This commit is contained in:
Pierre HUBERT 2020-04-13 08:46:39 +02:00
parent dbf30acd19
commit cff2cdada2
2 changed files with 10 additions and 0 deletions

View File

@ -236,6 +236,10 @@ class UserWebSocket {
case "call_peer_ready": case "call_peer_ready":
SendEvent("callPeerReady", msg.data); SendEvent("callPeerReady", msg.data);
break; break;
case "call_closed":
SendEvent("callClosed", msg.data);
break;
default: default:

View File

@ -111,6 +111,12 @@ document.addEventListener("callPeerReady", (e) => {
OpenCalls.get(detail.callID).PeerReady(detail.peerID) OpenCalls.get(detail.callID).PeerReady(detail.peerID)
}) })
document.addEventListener("callClosed", e => {
const callID = e.detail;
if(OpenCalls.has(callID))
OpenCalls.get(callID).Close(false);
});
document.addEventListener("wsClosed", () => { document.addEventListener("wsClosed", () => {
// Close all the current conversations // Close all the current conversations