Skip to main content

Video

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:

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

const video = new Video.Client({ project, token });

// Listen for events:
video.on("room.started", async (roomSession) => {
console.log("Room has started:", roomSession.name);

roomSession.on("member.joined", async (member) => {
console.log("Member joined:", member.name);
});
});

// Get active room sessions:
const { roomSessions } = await video.getRoomSessions();

Classes