Skip to content

Class: Room ​

Constructors ​

Constructor ​

ts
new Room(ctx): Room;

Parameters ​

ParameterType
ctxRoomContext

Returns ​

Room

Accessors ​

activeSpeakers ​

Get Signature ​

ts
get activeSpeakers(): string[];
Returns ​

string[]


audioOnlyFallback ​

Get Signature ​

ts
get audioOnlyFallback(): boolean;

Whether the media server is sending this client audio only: its connection stayed too slow for video, so the other participants' video is paused rather than frozen. The server tries video again on its own. Every change is an audioOnlyFallback event; the words are the host's. Only an sfu room falls back.

Returns ​

boolean


info ​

Get Signature ​

ts
get info(): RoomInfo;
Returns ​

RoomInfo


localParticipant ​

Get Signature ​

ts
get localParticipant(): LocalParticipant;
Returns ​

LocalParticipant


metadata ​

Get Signature ​

ts
get metadata(): Record<string, unknown>;
Returns ​

Record<string, unknown>


mode ​

Get Signature ​

ts
get mode(): RoomMode;
Returns ​

RoomMode


name ​

Get Signature ​

ts
get name(): string;
Returns ​

string


participants ​

Get Signature ​

ts
get participants(): RemoteParticipant[];

Everyone but me, active speakers first.

Returns ​

RemoteParticipant[]


polite ​

Get Signature ​

ts
get polite(): boolean;

Which side of a p2p call yields when both offer at once, assigned by the server. Exposed for diagnostics: a call that deadlocks is one where both ends believe the same thing.

Returns ​

boolean


recording ​

Get Signature ​

ts
get recording(): RoomRecording | null;

The room's recording, as the server last said: active, then stopped or failed; null until the room is recorded. Every change is also a recordingChanged event. Only a room in sfu mode is recorded, and only the participants whose clients claim recording — which this SDK does, because it tells its host every change — so a host that shows nothing when this says active is a recording nobody was told of. The words are the host's.

Returns ​

RoomRecording | null


sid ​

Get Signature ​

ts
get sid(): string;
Returns ​

string

Methods ​

acknowledgeRecording() ​

ts
acknowledgeRecording(): Promise<void>;

This user agrees to be recorded by the room's active recording. Call it only when the user said so: it stands for a person's consent. In a room whose recording has consentRequired, this user's media is recorded from now on; elsewhere it changes nothing. The acknowledgement is the identity's, for this recording only — a new recording asks again. Refused invalid_state when no recording is active.

Returns ​

Promise<void>


leave() ​

ts
leave(): Promise<void>;

A clean goodbye: the server does not wait out the departure grace, and in a p2p call an empty seat is the hangup.

Returns ​

Promise<void>


participant() ​

ts
participant(identity): RemoteParticipant | null;

Parameters ​

ParameterType
identitystring

Returns ​

RemoteParticipant | null


sendData() ​

ts
sendData(payload, opts?): Promise<void>;

A data message. Bytes on the wire; an object or a string is JSON-encoded for convenience, because the platform never parses it either way.

Parameters ​

ParameterType
payload| string | Record<string, unknown> | Uint8Array<ArrayBufferLike>
optsSendDataOptions

Returns ​

Promise<void>

Talkline documentation