swift-yacht-23770
12/06/2025, 11:18 AMtall-airline-16756
12/06/2025, 11:18 AMtall-airline-16756
12/06/2025, 11:18 AMReconnecting → Reconnected (or Disconnected), participants may briefly appear disconnected, and tracks are republished automatically.
• Mobile network changes (Wi‑Fi ⇄ cellular) are handled via ICE restart as well.
• If client/server state diverges, the server may disconnect with a STATE_MISMATCH reason; reconnection typically resolves this.
How you can control and handle it
• Listen for reconnection events and update UI:
room.on('reconnecting', () => { /* show reconnecting UI */ });
room.on('reconnected', () => { /* restore UI */ });
• Use Adaptive Stream so LiveKit reduces quality or pauses upstream video automatically when bandwidth drops.
• Use selective subscription / manual track control:
◦ Disable autoSubscribe and subscribe only to required tracks.
◦ Use publication.setEnabled(false) to stop sending/receiving a track without a full negotiation, saving bandwidth.
• Implement client-side monitoring to proactively lower quality or disable nonessential tracks during poor network conditions (e.g., change simulcast layer).
• Ensure tokens are refreshed during sessions (short expiry) so reconnections don’t require re-authentication.
Best practices
• Design the UI to show reconnecting state and graceful degradation (lower frame rate/resolution).
• Prefer adaptive streaming plus selective subscriptions to minimize disruption.
• Test on mobile with Wi‑Fi/cellular switching and simulate short disconnects to verify behavior.
Do you want code examples for adaptive stream setup, manual subscription flow, or a sample reconnection UI pattern?
Sources: Connecting to LiveKit | LiveKit docs | client-sdk-android | livekit/livekit_composite | DeepWiki | client-sdk-swift | livekit/livekit_composite | DeepWiki | Understanding the STATE_MISMATCH Disconnect Reason | Subscribing to tracks | LiveKit docs