Skip to main content
Deprecated 0.17.0 useActiveParticipant(params?) : Object | null useActiveParticipant can also set up an optional callback for the active-speaker-change event.

Parameters

ignoreLocal
boolean
If true, useActiveParticipant will not return a participant object when the local participant is the active speaker.
onActiveSpeakerChange
Function
Event callback for the active-speaker-change event listener.

Return value

Returns DailyParticipant | null. Contains detailed information about the participant, see participant properties. If no participant has unmuted, useActiveParticipant returns null.

Example

import { useActiveParticipant } from '@daily-co/daily-react';

export const CurrentSpeaker = () => {
  const activeSpeaker = useActiveParticipant();
  return (
    <div>{activeSpeaker?.user_name ?? 'Nobody'} is currently speaking.</div>
  );
};

See also