Returns the TranscriptionController for this realtime controller.
Returns whether the user can unmute.
Returns whether the current user is muted.
Mutes the audio input. If there is an active audio input, then a volume indicator update is also sent with the mute status for the current attendee id. It then synchronously notifies the callbacks if mute state changed. This mute is local and overrides any remote unmuted state received for the same attendee id.
Trigger callbacks when receiving a message from data channel
Send message via data channel
Sets whether the user will be able to mute and then synchronously fires the callbacks if can-mute state changed.
Subscribes to changes in attendee ids in order to discover attendee ids to subscribe and unsubscribe to for volume indicator updates.
Subscribes to receive a callback when a fatal error is generated while processing an action. Receiving this callback potentially means that it was not possible to successfully mute, and so should be handled by tearing down the current connection and starting over.
Subscribes to changes in local signal strength
Subscribes to local audio mutes and unmutes
Subscribe to receiving message on a topic
Subscribe to local send message event
Subscribes to the changes to the can unmute local audio state.
Subscribes to volume indicator changes for a specific attendee id with a callback. Volume is between 0.0 (min volume) and 1.0 (max volume). Signal strength can be 0 (no signal), 0.5 (weak signal), or 1 (good signal). A null value for any field means that it has not changed.
Unmutes the audio input if currently allowed. If there is an active audio input, then a volume indicator update is also sent with the mute status for the current attendee id. It then synchronously notifies the callbacks if mute state changed. This unmute is local and overrides any remote muted state received for the same attendee id.
Unsubscribe from a message topic
Unsubscribe from local send message event
Unsubscribes to volume indicator changes for a specific attendee id. Optionally, you can pass a callback parameter to unsubscribe from a specific callback. Otherwise, all callbacks will be unsubscribed (e.g. activeSpeaker).
Unsubscribes to changes in attendee ids.
Unsubscribes from receiving callbacks when fatal errors occur
Unsubscribes to changes in local signal strength
Unsubscribes to local audio mutes and unmutes
Unsubscribes to the changes to the can unmute local audio state.
Generated using TypeDoc
DefaultRealtimeController is written to adhere to the following tenets to make privacy and performance bugs significantly less likely.
Any call to the object is guaranteed to succeed from the caller's perspective to the maximum extent that this can be ensured. However, all failures of the object are reported as fatal errors. For example, if local mute fails, then that is a privacy issue and we must tear down the connection and try starting over.
State is owned by the object and is considered authoritative at all times. For example, if realtimeIsLocalAudioMuted is true then the user is muted.
Callbacks are fired synchronously and do their work synchronously. Any unnecessary asynchronous implementation only invites latency and increases the surface error for potential errors.
Mutation only occurs when state changes. All state-changing functions are idempotent.
Every conditional branch gets its own if statement and test coverage is 100% for this object.
Function parameters and returns use primitives only (no classes or enums). This minimizes the number of dependencies that consumers have to take on and allows the object to be more easily wrapped. Values are normalized where possible.
The object takes no other non-realtime dependencies.
Interface functions begin with
realtime
to make boundaries between the RealtimeController interface and the UI or business logic explicit and auditable.Local state overrides remote state but not vice-versa. For example, if locally muted with an active audio input and a remote state indicates the same user is unmuted because the muted state has not yet propagated, then the volume indicator update for the user would show the remote mute state as muted. However, if locally muted without an active audio input and a remote state indicates the user is unmuted (since they are dialed in), the remote state persists but does not override the local state so realtimeIsLocalAudioMuted still returns true.