useMediaTrack(params) : Object
There are also convenience hooks for each track type.
Parameters
A unique identifier for the participant
'audio' | 'video' | 'screenAudio' | 'screenVideo' | 'rmpAudio' | 'rmpVideo', specifies the kind of track. You can also pass the trackName of a custom track started via startCustomTrack(). Note: trackName is resolved internally as a participant-property path, so names containing a . will not resolve; use simple identifiers (e.g. my-track, not my.track).Return value
An object with the following properties:Includes detailed information about the given track. See participant tracks properties
Indicates whether a track is turned off or on,
true when track state is 'blocked' | 'off'Convenience hooks for specific track types
useAudioTrack
useAudioTrack(session_id: string) : MediaTrackState
Given a participant’s session_id, returns the MediaTrackState of their 'audio' track.
useScreenAudioTrack
useScreenAudioTrack(session_id: string) : MediaTrackState
Given a participant’s session_id, returns the MediaTrackState of their 'screenAudio' track.
useScreenVideoTrack
useScreenVideoTrack(session_id: string) : MediaTrackState
Given a participant’s session_id, returns the MediaTrackState of their 'screenVideo' track.
useVideoTrack
useVideoTrack(session_id: string) : MediaTrackState
Given a participant’s session_id, returns the MediaTrackState of their 'video' track.