Release user media

This commit is contained in:
Pierre HUBERT 2020-04-13 10:05:21 +02:00
parent 67e38faac9
commit c4e81d1ded

View File

@ -330,6 +330,11 @@ class CallWindow extends CustomEvents {
delete this.mainPeer; delete this.mainPeer;
} }
// Release user media
if(this.mainStream) {
this.mainStream.getTracks().forEach(e => e.stop())
}
// Destroy peer connections // Destroy peer connections
for(const el of this.peersEls) for(const el of this.peersEls)
el[1].destroy() el[1].destroy()
@ -501,6 +506,7 @@ class CallWindow extends CustomEvents {
videoEl.play() videoEl.play()
this.videoEls.set(peerID, videoEl) this.videoEls.set(peerID, videoEl)
} }
/** /**