Skip to main content

RoomSessionFullState

Objects of this type contain the full state of a RoomSession at a given point in time.

Properties

id
stringrequired

Unique id for this room session.

roomId
stringrequired

ID of the room associated to this room session.

name
stringrequired

Name of this room.

displayName
stringrequired

Display name for this room. Defaults to the value of name.

layoutName
stringrequired

Current layout name used in the room.

hideVideoMuted
booleanrequired

Whether muted videos are shown in the room layout. See setHideVideoMuted.

recording
booleanrequired

Whether recording is active.

members
RoomSessionMember[]

List of members that are part of this room session. See RoomSessionMember.

meta
Record<string, unknown>required

Metadata associated to this room session.

previewUrl
string

URL to the room preview.

recordings
any[]

List of active recordings in the room.

Example

Getting the full state of a room session when it starts:

import { SignalWire } from "@signalwire/realtime-api";

const client = await SignalWire({ project: "your-project-id", token: "your-api-token" });

const videoClient = client.video;

await videoClient.listen({
onRoomStarted: async (roomSession) => {
// roomSession contains the full state
console.log("Room ID:", roomSession.roomId);
console.log("Room Session ID:", roomSession.id);
console.log("Room Name:", roomSession.name);
console.log("Display Name:", roomSession.displayName);
console.log("Current Layout:", roomSession.layoutName);
console.log("Recording Active:", roomSession.recording);
console.log("Hide Video Muted:", roomSession.hideVideoMuted);
console.log("Metadata:", roomSession.meta);

if (roomSession.members) {
console.log("Members in room:", roomSession.members.length);
roomSession.members.forEach(member => {
console.log("- Member:", member.name, "ID:", member.id);
});
}

if (roomSession.previewUrl) {
console.log("Preview URL:", roomSession.previewUrl);
}
}
});

Methods

You get the same methods that are available on a RoomSession object.