mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-22 20:19:21 +00:00
Handles remote peer streams interruption
This commit is contained in:
parent
04812e21bb
commit
b82cba518d
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user