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 and setLocalVideo accept an optional second argument:
boolean
setLocalAudio only. When true, the underlying mic MediaStreamTrack is discarded (stopped) on mute rather than kept alive. Use this when you want the microphone indicator to turn off on mute. Defaults to false, so the mic track stays alive on mute (avoiding clipped audio on unmute) unless you opt in.
boolean
setLocalVideo only. Per-call override of whether the camera MediaStreamTrack is discarded (stopped) on mute: true discards it even when the keepCamIndicatorLightOn call option is set; false keeps it alive for a faster unmute (the camera indicator light stays on). When omitted, the default applies: the camera track is discarded on mute unless keepCamIndicatorLightOn is 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:
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.
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

For most apps, don’t turn noise cancellation on by default for everyone. It runs a Krisp model on the CPU for every second of audio. On older or low-powered devices, that load can hurt the call more than the noise it removes: choppy audio and dropped video frames. When the CPU can’t keep up, daily-js pauses processing and can emit an audio-processor-error. Let users turn it on when they need it, and only enable it by default on devices you have tested.
Noise cancellation is a device setting, not a transport setting. It runs on the input, on the audio the capturer gets from your microphone. Daily supports noise, gain and volume settings in both the JS and native SDKs. Noise cancellation does not apply to echo that is already in remote or received audio. For example, when a caller comes in through the phone dialer, the phone dialer has to apply the echo cancellation. See echo cancellation and noise suppression on phone and SIP audio.

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

Passing inputSettings to join() turns processing on for every user. Read the noise cancellation warning above first.
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