setPrioritizeHandraise

View as Markdown

setPrioritizeHandraise

  • setPrioritizeHandraise(param): Promise<boolean>

Set whether to prioritize hand-raise or not. Users with raised hands will be shown in the main video area over other participants who don’t have their hand raised.

Parameters

param
booleanDefaults to trueRequired

Whether to prioritize participants on the canvas with their hand-raised. If omitted, the hand status is toggled to the opposite of the current status.

Returns

Promise<boolean>

Example

In this example, we wait for a room to start and then set the room to prioritize hand-raise.

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
10
11await videoClient.listen({
12 onRoomStarted: async (roomSession) => {
13 console.log("Room started", roomSession.displayName);
14
15 // Set the room to prioritize hand-raise
16 await roomSession.setPrioritizeHandraise(true);
17 }
18});