useActiveSpeakerId

useActiveSpeakerId(params?) : string | null

Returns the participant's session_id mentioned in the most recent active-speaker-change event.

useActiveSpeakerId can also set up an optional callback for the active-speaker-change event.

Params (optional)

ParameterTypeDescription
ignoreLocalbooleanIf true, useActiveSpeakerId will ignore when the local participant is the active speaker
onActiveSpeakerChangeFunctionEvent callback for active-speaker-change event listener

Return type

TypeDescription
string | nullThe active speaker's session_id. If no participant has unmuted, useActiveSpeakerId returns null

Sample code