videoMute

View as Markdown

videoMute

  • videoMute(params): Promise<void>

Puts the video of a given member on mute. Participants will see a mute image instead of the video stream.

Parameters

params
object

Object containing the parameters of the method.

memberId
string

ID of the member to mute.

Returns

Promise<void>

Example

In this example, we wait for a room to start and then wait for a second member to join the room. When a second member joins the room, we mute the video of that member. This example assumes that there is a RoomSession already active and that members are joining the room.

1import { SignalWire } from "@signalwire/realtime-api";
2
3// Initialize the SignalWire client
4const client = await SignalWire({ project: "ProjectID Here", token: "Token Here" });
5
6// Access video client from the main client
7const videoClient = client.video;
8
9// Setup listener for when a room starts
10await videoClient.listen({
11 onRoomStarted: async (roomSession) => {
12 console.log("Room started", roomSession.displayName);
13
14 await roomSession.listen({
15 onMemberJoined: (member) => {
16 console.log("Member joined", member.name);
17
18 // Video mute the member
19 roomSession.videoMute({
20 memberId: member.id,
21 })
22 },
23 onMemberUpdated: (member) => {
24 console.log("Member mute status updated", member.name, member.videoMuted);
25 },
26 });
27 }
28});