The useTracks hook returns an array of TrackReference or TrackReferenceOrPlaceholder depending on the provided sources property.
If only subscribed tracks are desired, set the onlySubscribed property to true.
Example
// Return all camera track publications. consttrackReferences: TrackReference[] = useTracks([Track.Source.Camera])
Example
// Return all subscribed camera tracks as well as placeholders for // participants without a camera subscription. consttrackReferencesWithPlaceholders: TrackReferenceOrPlaceholder[] = useTracks([{source:Track.Source.Camera, withPlaceholder:true}])
The
useTracks
hook returns an array ofTrackReference
orTrackReferenceOrPlaceholder
depending on the providedsources
property. If only subscribed tracks are desired, set theonlySubscribed
property totrue
.Example
Example