setHideVideoMuted

View as Markdown

setHideVideoMuted

  • setHideVideoMuted(value): Promise<void>

Show or hide muted videos in the room layout. Members that have been muted via videoMute will not appear in the video stream, instead of appearing as a mute image, if this setting is enabled.

Muted videos are shown by default.

Parameters

value
booleanRequired

Whether to hide muted videos in the room layout.

Returns

Promise<void>

Example

In this example, we wait for a room to start and then hide muted videos in the room layout. If you mute your video, you will not appear in the video stream, instead of appearing as a mute image. 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 the 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 // Setup listener for when a room is updated
15 roomsession.listen({
16 onRoomUpdated: async (roomsession) => {
17 console.log(`Updated room ${roomsession.displayName} to hide muted videos!`);
18 }
19 });
20 // Hide muted videos in the room layout
21 roomsession.setHideVideoMuted(true);
22 }
23})