Update y-webrtc.js
This commit is contained in:
parent
b6c6d4890e
commit
20c8e02c12
1 changed files with 4 additions and 2 deletions
|
@ -358,8 +358,7 @@ export class Room {
|
||||||
encoding.writeVarUint8Array(encoderAwareness, awarenessProtocol.encodeAwarenessUpdate(this.awareness, changedClients))
|
encoding.writeVarUint8Array(encoderAwareness, awarenessProtocol.encodeAwarenessUpdate(this.awareness, changedClients))
|
||||||
broadcastRoomMessage(this, encoding.toUint8Array(encoderAwareness))
|
broadcastRoomMessage(this, encoding.toUint8Array(encoderAwareness))
|
||||||
}
|
}
|
||||||
this.doc.on('update', this._docUpdateHandler)
|
|
||||||
this.awareness.on('update', this._awarenessUpdateHandler)
|
|
||||||
window.addEventListener('beforeunload', () => {
|
window.addEventListener('beforeunload', () => {
|
||||||
awarenessProtocol.removeAwarenessStates(this.awareness, [doc.clientID], 'window unload')
|
awarenessProtocol.removeAwarenessStates(this.awareness, [doc.clientID], 'window unload')
|
||||||
rooms.forEach(room => {
|
rooms.forEach(room => {
|
||||||
|
@ -369,6 +368,9 @@ export class Room {
|
||||||
}
|
}
|
||||||
|
|
||||||
connect () {
|
connect () {
|
||||||
|
this.doc.on('update', this._docUpdateHandler)
|
||||||
|
this.awareness.on('update', this._awarenessUpdateHandler)
|
||||||
|
|
||||||
// signal through all available signaling connections
|
// signal through all available signaling connections
|
||||||
announceSignalingInfo(this)
|
announceSignalingInfo(this)
|
||||||
const roomName = this.name
|
const roomName = this.name
|
||||||
|
|
Loading…
Reference in a new issue