diff --git a/.changeset/many-stingrays-joke.md b/.changeset/many-stingrays-joke.md new file mode 100644 index 0000000000..d3457e1737 --- /dev/null +++ b/.changeset/many-stingrays-joke.md @@ -0,0 +1,5 @@ +--- +"livekit-client": patch +--- + +Register online listener in engine's join diff --git a/src/room/RTCEngine.ts b/src/room/RTCEngine.ts index 4db6f23a59..effe0912c3 100644 --- a/src/room/RTCEngine.ts +++ b/src/room/RTCEngine.ts @@ -211,7 +211,6 @@ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmit this.client = new SignalClient(undefined, this.loggerOptions); this.client.signalLatency = this.options.expSignalLatency; this.reconnectPolicy = this.options.reconnectPolicy; - this.registerOnLineListener(); this.closingLock = new Mutex(); this.dataProcessLock = new Mutex(); this.dcBufferStatus = new Map([ @@ -271,6 +270,7 @@ export default class RTCEngine extends (EventEmitter as new () => TypedEventEmit this.negotiate(); } + this.registerOnLineListener(); this.clientConfiguration = joinResponse.clientConfiguration; this.emit(EngineEvent.SignalConnected, joinResponse); return joinResponse;