useActiveSpeakerId
useActiveSpeakerId(params?) : string | null
Returns the participant's session_id
mentioned in the most recent 'active-speaker-change'
event. Use this property to limit active speakers returned from this hook to subgroups.
Apply a filter
to limit which participants should be considered as active speakers.
Params (optional)
Parameter | Type | Description |
---|---|---|
filter | Function | Callback function to filter which participants should be considered as active speakers by this hook instance. Return true to allow the passed session_id to become the next active speaker. |
ignoreLocal | boolean | If true , useActiveSpeakerId will ignore when the local participant is the active speaker |
Return type
Type | Description |
---|---|
string | null | The active speaker's session_id . If no participant has unmuted, useActiveSpeakerId returns null |
Sample code
Related references
- useActiveParticipant()
- useLocalParticipant()
- useLocalSessionId()
- useParticipantCounts()
- useParticipantIds()
- useParticipantProperty()
- useParticipant()
- useWaitingParticipants()