Muting and unmuting
Check the current mute state withlocalAudio() and localVideo(), then toggle with the matching setters.
setLocalAudio accepts an optional second argument:
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.Starting camera before joining
CallstartCamera() 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.
DailyCallOptions to startCamera() to pre-configure devices or input settings:
Joining with audio or video off
SetstartAudioOff 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
UseenumerateDevices() to get all available media devices:
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):
DailyDeviceInfos:
Switching input devices
By device ID
UsesetInputDevicesAsync() to switch the active camera or microphone by deviceId:
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.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 customMediaStreamTrack — use updateInputSettings() with audio.settings or video.settings instead:
Switching the output device
UsesetOutputDeviceAsync() 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.
noAutoDefaultDeviceChange: true in dailyConfig:
available-devices-updated to respond to device changes manually.
Device change events
Listen foravailable-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 theface-counts-updated event:
Enabling at join time
input-settings-updated to track changes:
Video processors require browser support for
OffscreenCanvas and WebGL. Check Daily.supportedBrowser().supportsVideoProcessing before enabling them.