Add clear array peer connection sharing

This commit is contained in:
Gregoire Parant 2021-01-07 12:58:45 +01:00
parent a88ad3cf4d
commit e8f1b2d048

View File

@ -229,6 +229,14 @@ export class SimplePeer {
} catch (err) {
console.error("closeConnection", err)
}
//if user left discussion, clear array peer connection of sharing
if(this.Users.length === 0) {
for (const userId of this.PeerScreenSharingConnectionArray.keys()) {
this.closeScreenSharingConnection(userId);
this.PeerScreenSharingConnectionArray.delete(userId);
}
}
}
/**