setRaisedHand

View as Markdown

setRaisedHand

  • setRaisedHand(params): Promise<void>

Sets the raised hand status for the current member.

Parameters

params
objectRequired

Object containing the parameters of the method.

memberId
stringRequired

ID of the member to affect.

raised
booleanDefaults to true

Whether to raise or lower the hand. If omitted, the hand status is toggled to the opposite of the current status.

Returns

Promise<void>

Example

In this example, we wait for a member to join the room and then set the raised hand status for that member to true.

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 // Setup listener for when a member joins the room
15 await roomSession.listen({
16 onMemberJoined: async (member) => {
17 console.log("Member joined", member.name);
18
19 // Set the raised hand status for the member
20 await roomSession.setRaisedHand({
21 memberId: member.id,
22 raised: true
23 });
24 }
25 });
26 }
27});