Overloading destroy method instead of having a separate method to remove video.

This commit is contained in:
David Négrier 2020-08-20 22:23:22 +02:00
parent 27ffb6b13d
commit 1162439479
3 changed files with 10 additions and 10 deletions

View file

@ -189,7 +189,7 @@ export class SimplePeer {
console.warn("Tried to close connection for user "+userId+" but could not find user")
return;
}
peer.closeConnection();
peer.destroy();
// FIXME: I don't understand why "Closing connection with" message is displayed TWICE before "Nb users in peerConnectionArray"
// I do understand the method closeConnection is called twice, but I don't understand how they manage to run in parallel.
//console.log('Closing connection with '+userId);
@ -220,7 +220,7 @@ export class SimplePeer {
// FIXME: I don't understand why "Closing connection with" message is displayed TWICE before "Nb users in peerConnectionArray"
// I do understand the method closeConnection is called twice, but I don't understand how they manage to run in parallel.
//console.log('Closing connection with '+userId);
peer.closeScreenSharingConnection();
peer.destroy();
this.PeerScreenSharingConnectionArray.delete(userId)
//console.log('Nb users in peerConnectionArray '+this.PeerConnectionArray.size);
} catch (err) {