Skip to main content

Connection Status

The current connection state is synchronously readable from the status field of type ConnectionStatus:

const currentStatus = conn.status;

// Example:
if (conn.status === ConnectionStatus.Open) {
// ...
}

Status changes are exposed as an observable stream. All messages have a type property of type ConnectionStatus. Use this if you want to react to any changes:

conn.status$.subscribe(status => {
// ...
});

The ConnectionStatus enum has the following fields and values:

ValueEnum field nameDescription
OPENINGOpeningConnecting to the mixer
OPENOpenSuccessfully connected to the mixer
CLOSINGClosingDisconnecting from the mixer
CLOSECloseDisconnected from the mixer
ERRORErrorConnection error occured. The error object can be accessed through the payload property of the message.
RECONNECTINGReconnectingAfter an error, trying reconnection