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.
useActiveSpeakerId
can also set up an optional callback for the 'active-speaker-change'
event.
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 |
onActiveSpeakerChange | Function | Event callback for 'active-speaker-change' event listener |
Return type
Type | Description |
---|---|
string | null | The active speaker's session_id . If no participant has unmuted, useActiveSpeakerId returns null |