ws-fallback: prevent signaling from stopping on reconnect. Do not stop to signal until both devices have sent event "peer-connected"
This commit is contained in:
parent
d6ef5887dd
commit
bbb8c1b10f
1 changed files with 4 additions and 4 deletions
|
@ -707,15 +707,15 @@ class WSPeer extends Peer {
|
||||||
this._server.send(message);
|
this._server.send(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
_sendSignal() {
|
_sendSignal(connected = false) {
|
||||||
this.sendJSON({type: 'signal'});
|
this.sendJSON({type: 'signal', connected: connected});
|
||||||
}
|
}
|
||||||
|
|
||||||
onServerMessage(message) {
|
onServerMessage(message) {
|
||||||
Events.fire('peer-connected', {peerId: message.sender.id, connectionHash: this.getConnectionHash()})
|
Events.fire('peer-connected', {peerId: message.sender.id, connectionHash: this.getConnectionHash()})
|
||||||
if (this._peerId) return;
|
if (message.connected) return;
|
||||||
this._peerId = message.sender.id;
|
this._peerId = message.sender.id;
|
||||||
this._sendSignal();
|
this._sendSignal(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
getConnectionHash() {
|
getConnectionHash() {
|
||||||
|
|
Loading…
Reference in a new issue