diff --git a/peer-stream.js b/peer-stream.js index b37afc8..17b2a9f 100644 --- a/peer-stream.js +++ b/peer-stream.js @@ -138,17 +138,10 @@ class PeerStream extends HTMLVideoElement { }; this.ws.onclose = (e) => { - let timeout = 3000; - if (e.code === 3333) { - this.id = e.reason; - console.log("redirect =>", e.reason); - timeout = 500; - } else { - console.warn(e); - } - this.dispatchEvent(new CustomEvent("playerdisconnected",{})); + console.warn(e); + this.dispatchEvent(new CustomEvent("playerdisconnected",{})); clearTimeout(this.reconnect); - this.reconnect = setTimeout(() => this.connectedCallback(), timeout); + this.reconnect = setTimeout(() => this.connectedCallback(), 3000); }; }