Video

View as Markdown

Access the Video API Consumer. You can instantiate a Video.Client to subscribe to Video events. Make sure to check the full list of events that a Video.Client can subscribe to.

Example

The following example logs whenever a room session is started or a user joins it:

1import { Video } from "@signalwire/realtime-api";
2
3const video = new Video.Client({ project, token });
4
5// Listen for events:
6video.on("room.started", async (roomSession) => {
7 console.log("Room has started:", roomSession.name);
8
9 roomSession.on("member.joined", async (member) => {
10 console.log("Member joined:", member.name);
11 });
12});
13
14// Get active room sessions:
15const { roomSessions } = await video.getRoomSessions();

Classes