Handles remote peer streams interruption

This commit is contained in:
Pierre HUBERT 2020-04-14 09:48:30 +02:00
parent 04812e21bb
commit b82cba518d
3 changed files with 18 additions and 3 deletions

View File

@ -237,6 +237,10 @@ class UserWebSocket {
SendEvent("callPeerReady", msg.data); SendEvent("callPeerReady", msg.data);
break; break;
case "call_peer_interrupted_streaming":
SendEvent("callPeerInterruptedStreaming", msg.data);
break;
case "call_closed": case "call_closed":
SendEvent("callClosed", msg.data); SendEvent("callClosed", msg.data);
break; break;

View File

@ -111,6 +111,13 @@ document.addEventListener("callPeerReady", (e) => {
OpenCalls.get(detail.callID).PeerReady(detail.peerID) OpenCalls.get(detail.callID).PeerReady(detail.peerID)
}) })
document.addEventListener("callPeerInterruptedStreaming", (e) => {
const detail = e.detail
if(OpenCalls.has(detail.callID))
OpenCalls.get(detail.callID).RemoveMemberConnection(detail.peerID)
})
document.addEventListener("callClosed", e => { document.addEventListener("callClosed", e => {
const callID = e.detail; const callID = e.detail;

View File

@ -850,9 +850,13 @@ class CallWindow extends CustomEvents {
this.refreshButtonsState() this.refreshButtonsState()
// Propagate information // Propagate information
await ws("calls/stop_streaming", { try {
callID: this.callID await ws("calls/stop_streaming", {
}) callID: this.callID
})
} catch(e) {
console.log("Failed to notify of streaming stop", e)
}
} }
/** /**