Skip to main content
Media is the one part of a call that has to touch the DOM: a video track needs a <video> element, an audio track needs an <audio> element. Daily React provides components that own that work so your render stays declarative.

Render video with DailyVideo

DailyVideo renders a <video> for a participant’s track. Give it a sessionId and a track type:
Useful props:
  • type'video' (camera, the default) or 'screenVideo' (screen share).
  • automirror — mirrors the local camera, the convention users expect when seeing themselves.
  • fit'contain' (default) or 'cover', mapping to CSS object-fit.
  • playableStyle — styles applied only while the video is actually playing, handy for hiding the element or showing a placeholder when the camera is off.

Style from the data attributes

DailyVideo renders data attributes you can target with CSS instead of reaching into props for conditional styling: data-playable, data-local, data-mirrored, data-session-id, data-subscribed, and data-video-type. For example, dim a tile until its video is playable:

Play audio with DailyAudio

Render exactly one DailyAudio for the whole call. It plays all remote audio and screenAudio tracks, manages a pool of speaker slots, and handles the autoplay failures that browsers throw at you:
Do not render one DailyAudio per tile. It is a single, call-wide component. Use DailyAudioTrack if you genuinely need per-participant audio elements.
By default DailyAudio keeps up to 5 speaker slots; raise it with maxSpeakers. Handle playback failures with onPlayFailed:
To reach the underlying <audio> elements, for example to set output volume, pass a ref and use its methods such as getAllAudio() and getAudioBySessionId(sessionId).

Custom audio with DailyAudioTrack

When you need to compose audio yourself, DailyAudioTrack renders a single <audio> for one participant and track type. Most apps should use DailyAudio instead; reach for DailyAudioTrack only when you need direct control over each element:

Read track state with useMediaTrack

When you need the track itself or its state rather than a rendered element, use useMediaTrack. It returns the MediaTrackState plus an isOff convenience boolean:
There are convenience hooks for each track type: useVideoTrack, useAudioTrack, useScreenVideoTrack, and useScreenAudioTrack, each taking just a sessionId.
Use useMediaTrack to drive placeholders: when isOff is true, render an avatar instead of the <video>. To attach a track to your own element you can read track.persistentTrack, but prefer DailyVideo unless you have a specific reason not to.

A complete tile

Putting video, name, and a mic indicator together:

Next steps

Devices

Let users pick and toggle their camera and mic.

Screen sharing

Render and control screen shares.