When reconnection triggers
Reconnection flow
- WebSocket closes with code 1005 or 1006
- SDK emits
reconnectStreamstate:"disconnected" - SDK emits state:
"reconnecting" - After a 5-second delay, SDK emits state:
"retrying"and reconnects to the signaling server - On success: SDK emits state:
"connected"and theplayStreamevent fires - On failure or if 60 seconds have elapsed since the first disconnect: SDK emits state:
"failed"with code4007
The 60-second reconnection window starts from the first disconnect. If the connection drops repeatedly within that window, each attempt still counts against the 60-second limit.
Listening for reconnection state
State values
Disconnect codes and reasons
When the connection closes intentionally,data.reason may contain one of these messages:
These disconnections do not trigger automatic reconnection.
Parent window communication
The SDK also sends disconnect events to the parent window (useful when the stream is embedded in an iframe):Next steps
Connection lifecycle
Map the events fired during initial connection setup.
Queue system
Display queue position updates when UE instances are busy.