This commit is contained in:
boufni95 2025-01-27 22:05:44 +00:00
parent 001c289d24
commit 4a55bd6b77

View file

@ -52,7 +52,7 @@ export default class webRTC {
const key = this.getConnectionsKey(u) const key = this.getConnectionsKey(u)
console.log("connect", key) console.log("connect", key)
if (this.connections[key]) { if (this.connections[key]) {
throw new Error('Connection already exists') this.connections[key].close()
} }
const conn = new wrtc.RTCPeerConnection(configuration) as RTCPeerConnection const conn = new wrtc.RTCPeerConnection(configuration) as RTCPeerConnection
conn.onicecandidate = (event) => { conn.onicecandidate = (event) => {