The connection has been shut down and cannot be used again.
Negotiation finished and the connection is fully established.
It is reached after 'connected', so gate the application on that one instead: it is the state every agent type reports.
The stream is live: the agent can be spoken to and its video rendered.
The connection is being established, or re-established after a drop.
The stream has ended.
The reason argument of
onConnectionStateChange says why —
a StreamEndReason when the server ended the session deliberately. Reconnecting with
reconnect() starts a new stream.
disconnect() is in progress.
Expressive (V4) agents only; Talks (V2) and Clips (V3) go straight from 'connected' to 'disconnected'.
The connection could not be established, or dropped irrecoverably.
The connection object exists but nothing has been negotiated yet.
The state of the connection between the browser and the agent's stream.
The first argument of onConnectionStateChange. 'connected' is the point at which chat() and speak() can be called.
Every agent type reports
'connecting','connected','fail'and'disconnected';'new','completed'and'closed'are WebRTC ICE states that only Talks (V2) and Clips (V3) agents reach, and'disconnecting'is Expressive (V4) only.