Valora
API Reference@valora-ai/reactindexFunctions

useParticipantTracks

function useParticipantTracks(sources): unknown[];

Defined in: packages/react/src/hooks/participant/useParticipantTracks.ts:20

useParticipantTracks is a custom React that allows you to get tracks of a specific participant only, by specifiying the participant's identity. If the participant identity is not passed the hook will try to get the participant

Parameters

ParameterType
sourcesTrackSource[]

Returns

unknown[]

Example

function ParticipantMedia() {
  const tracks = useParticipantTracks(["camera", "screen_share"]);
  return <TrackLoop tracks={tracks}><ParticipantTile /></TrackLoop>;
}

On this page

Valora is local-first

No API key, no server — everything in this doc runs on-device.

Star on GitHub