Skip to main content
useActiveSpeakerId(params?) : string | null Use a filter to limit which participants should be considered as active speakers.

Parameters

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 value

Returns string | null. The active speaker’s session_id. If no participant has unmuted, useActiveSpeakerId returns null.

Example

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

export const CurrentSpeaker = () => {
  const activeSpeakerId = useActiveSpeakerId();
  return <div>Current speaker id: {activeSpeakerId ?? 'none'}</div>;
};

See also