Skip to main content
Daily gives you fine-grained control over microphone and camera state, device selection, and audio level monitoring — both before and during a call.

Muting and unmuting

Check the current mute state with localAudio() and localVideo(), then toggle with the matching setters.
setLocalAudio accepts an optional second argument:
options.forceDiscardTrack
boolean
When true, the underlying MediaStreamTrack is discarded (stopped) on mute rather than kept alive. Use this when you want the microphone indicator to turn off on mute. If not set, defaults to the keepCamIndicatorLightOn value from dailyConfig, or false if that is not set.
Setting forceDiscardTrack: true for audio can cause the beginning of a participant’s audio to be clipped when they unmute. Because the track is fully discarded, remote participants must complete the entire track subscription process again when the sender unmutes — rather than simply resuming a paused track.

Starting camera before joining

Call startCamera() to acquire device permissions and start the camera/mic pipeline before the user joins a room. This lets you display a preview and confirm device selection on a pre-join screen.
You can also pass DailyCallOptions to startCamera() to pre-configure devices or input settings:

Joining with audio or video off

Set startAudioOff and/or startVideoOff to false in your call configuration before joining or starting the camera to have the participant join with their mic and/or camera off and override any room or token settings.

Enumerating available devices

Use enumerateDevices() to get all available media devices:
Each entry is a DailyMediaDeviceInfo — a superset of MediaDeviceInfo with an optional facing field ('user' | 'environment') for cameras on mobile devices.

Reading the active devices

getInputDevices() returns the devices currently in use (or expected to be used):
The return type is DailyDeviceInfos:

Switching input devices

By device ID

Use setInputDevicesAsync() to switch the active camera or microphone by deviceId:
audioDeviceId
string | false
The deviceId of the microphone to use. Setting to false will turn off the microphone and disallow the user to turn it back on until a valid deviceId or true is passed.
videoDeviceId
string | false
The deviceId of the camera to use. Setting to false will turn off the camera and disallow the user to turn it back on until a valid deviceId or true is passed.

With constraints or a custom track

For anything beyond a simple device ID swap — such as applying media constraints or supplying a custom MediaStreamTrack — use updateInputSettings() with audio.settings or video.settings instead:

Switching the output device

Use setOutputDeviceAsync() to change the speaker or audio output device:
setOutputDeviceAsync() is only supported in browsers that implement HTMLMediaElement.setSinkId(). Most non-Android browsers now support this. Safari only recently added support in 18.4 and may have some quirks. Safari also requires a user gesture to switch audio output devices, so be sure to call this from a click handler or similar.

Cycling camera and mic

For mobile or simple use cases, cycleCamera() and cycleMic() rotate through available devices without you having to enumerate them manually:

Automatic device switching

Daily automatically handles two common device disruption scenarios without any code on your part:
  • System default changes — if the active device is set to the system default (Chrome uses deviceId: "default"; other browsers use the first device in the list) and the user changes their system default, Daily switches to the new default.
  • Active device disconnected — if the currently selected device is unplugged or becomes unavailable, Daily switches to the next available device.
To disable this behavior and manage device changes yourself, set noAutoDefaultDeviceChange: true in dailyConfig:
When disabled, you can listen for available-devices-updated to respond to device changes manually.

Device change events

Listen for available-devices-updated when the system’s device list changes (e.g., a USB camera is plugged in), and selected-devices-updated when the active devices change:

Monitoring local audio level

Daily can poll the local participant’s microphone volume and emit it as an event, which is useful for building a mic-level indicator.
1

Start the observer

2

Listen for audio level events

3

Read the level imperatively (optional)

4

Stop the observer when no longer needed

Monitoring remote participants’ audio levels

To monitor the audio levels of all remote participants simultaneously (useful for displaying speaking indicators):

Audio and video processing

updateInputSettings() applies real-time processing to your audio and video tracks. You can pass inputSettings directly to join() or startCamera() to enable processing before the first frame is captured, or call it at any time during a call.

Noise cancellation

Background blur

strength ranges from 0 (no blur) to 1 (maximum blur):

Background image replacement

Face detection

Enables face detection processing. Detected face counts are reported via the face-counts-updated event:

Enabling at join time

Listen for input-settings-updated to track changes:
Video processors require browser support for OffscreenCanvas and WebGL. Check Daily.supportedBrowser().supportsVideoProcessing before enabling them.

Complete device-switcher example