Hand Raise
Prerequisites:
Minimum required SDK version
Raise Hand and lower hand is now supported as a first class API with 100ms.
interface HMSPeer { ... isHandRaised: boolean; }
Raise Hand
async function toggleRaiseHand() { const localPeerId = hmsStore.getState(selectLocalPeerID); const isHandRaised = hmsStore.getState(selectHasPeerHandRaised(localPeerId)); if (isHandRaised) { await hmsActions.lowerLocalPeerHand(); } else { await hmsActions.raiseLocalPeerHand(); } }
Hand Raise update Notification
Once the hand raise is updated by local peer, all the peers will receive a notification
with type HAND_RAISE_CHANGED
and HMSPeer
object as notification data.
hmsNotifications.onNotification((notification) => { const peer = notification.data; const isHandRaised = peer.isHandRaised; if (isHandRaised && !peer.isLocal) { toast(`${peer.name} raised their hand.`); } }, HMSNotificationTypes.HAND_RAISE_CHANGED);
Have a suggestion? Recommend changes ->