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);
break;
case "call_peer_interrupted_streaming":
SendEvent("callPeerInterruptedStreaming", msg.data);
break;
case "call_closed":
SendEvent("callClosed", msg.data);
break;

View File

@ -111,6 +111,13 @@ document.addEventListener("callPeerReady", (e) => {
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 => {
const callID = e.detail;

View File

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