> ## Documentation Index
> Fetch the complete documentation index at: https://docs.daily.co/llms.txt
> Use this file to discover all available pages before exploring further.

# useMediaTrack

> Given a participant session_id and type of track, returns the corresponding track and its state.

`useMediaTrack(params) : Object`

There are also [convenience hooks](#convenience-hooks-for-specific-track-types) for each track type.

## Parameters

<ParamField body="session_id" type="string" required>
  A unique identifier for the participant
</ParamField>

<ParamField body="type" type="string" default="'video'">
  `'audio' | 'screenAudio' | 'screenVideo' | 'video'`, specifies the kind of track
</ParamField>

## Return value

An object with the following properties:

<ResponseField name="MediaTrackState" type="Object">
  Includes detailed information about the given track. See [participant tracks properties](/reference/daily-js/types/daily-track-state)
</ResponseField>

<ResponseField name="isOff" type="boolean">
  Indicates whether a track is turned off or on, `true` when track state is `'blocked' | 'off'`
</ResponseField>

## Convenience hooks for specific track types

### useAudioTrack

`useAudioTrack(session_id: string) : MediaTrackState`

Given a participant's `session_id`, returns the [`MediaTrackState`](#return-value) of their `'audio'` track.

### useScreenAudioTrack

`useScreenAudioTrack(session_id: string) : MediaTrackState`

Given a participant's `session_id`, returns the [`MediaTrackState`](#return-value) of their `'screenAudio'` track.

### useScreenVideoTrack

`useScreenVideoTrack(session_id: string) : MediaTrackState`

Given a participant's `session_id`, returns the [`MediaTrackState`](#return-value) of their `'screenVideo'` track.

### useVideoTrack

`useVideoTrack(session_id: string) : MediaTrackState`

Given a participant's `session_id`, returns the [`MediaTrackState`](#return-value) of their `'video'` track.

## Example

```jsx theme={null}
import { useMediaTrack } from '@daily-co/daily-react';

export const UseMediaTrackDemo = (props) => {
  const sessionID = props.session_id;
  const mediaTrack = useMediaTrack(sessionID, "audio");

  return (
      <div>Audio {mediaTrack.isOff ? "off" : "on"}</div>
  )
};
```

## See also

<CardGroup>
  <Card title="Components" icon="layout" iconType="solid">
    * [DailyAudioTrack](/reference/daily-react/daily-audio-track)
    * [DailyAudio](/reference/daily-react/daily-audio)
    * [DailyVideo](/reference/daily-react/daily-video)
  </Card>

  <Card title="Hooks" icon="code" iconType="solid">
    * [useAudioLevelObserver()](/reference/daily-react/use-audio-level-observer)
  </Card>

  <Card title="daily-js methods" icon="code" iconType="solid">
    * [participants() — tracks properties](/reference/daily-js/types/daily-track-state)
  </Card>
</CardGroup>
