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
| Parameter | Type |
|---|---|
sources | TrackSource[] |
Returns
unknown[]
Example
function ParticipantMedia() {
const tracks = useParticipantTracks(["camera", "screen_share"]);
return <TrackLoop tracks={tracks}><ParticipantTile /></TrackLoop>;
}