useActiveParticipant(params?) : Object | null

Returns an object for the participant id mentioned in the most recent active-speaker-change event.

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

Params (optional)

ignoreLocalbooleanIf true, useActiveParticipant will not return a participant object when the local participant is the active speaker
onActiveSpeakerChangeFunctionevent callback for active-speaker-change event listener

Return type

Object | nullContains detailed information about the participant, see participant properties. If no participant has unmuted, useActiveParticipant returns null

Sample code

Related references