[[RealtimeState]] stores all realtime persistent state.

Constructors

Properties

attendeeIdChangesCallbacks: (
    attendeeId: string,
    present: boolean,
    externalUserId: string,
    dropped: boolean,
    posInFrame: RealtimeAttendeePositionInFrame,
) => void[] = []

Callbacks to listen for attendee id changes

attendeeIdToExternalUserId: { [attendeeId: string]: string } = {}

Stores attendee id to external user id mappings

canUnmute: boolean = true

Stores whether the user can transition from muted to unmuted

fatalErrorCallbacks: (error: Error) => void[] = []

Callbacks to listen for fatal errors

localAttendeeId: string = null

Stores the attendee id of the current user

localExternalUserId: string = null

Stores the external user id of the current user

localSignalStrengthChangeCallbacks: (signalStrength: number) => void[] = []

Callbacks to listen for changes to local signal strength

muteAndUnmuteLocalAudioCallbacks: (muted: boolean) => void[] = []

Callbacks to listen for local audio mutes and unmutes

muted: boolean = false

Stores whether the user is presently muted

receiveDataMessageCallbacks: Map<string, (dataMessage: DataMessage) => void[]> = ...

Callbacks to listen for receiving message from data channel based on given topic

sendDataMessageCallbacks: (
    topic: string,
    data: any,
    lifetimeMs?: number,
) => void[] = []

Callbacks to trigger when sending message

setCanUnmuteLocalAudioCallbacks: (canUnmute: boolean) => void[] = []

Callbacks to listen for changes to can-unmute local audio state

volumeIndicatorCallbacks: { [key: string]: VolumeIndicatorCallback[] } = {}

Stores per-attendee id callbacks called when volume indicators change

volumeIndicatorState: { [key: string]: RealtimeVolumeIndicator } = {}

Stores per-attendee id volume indicator state