setInputDevicesAsync(devices)
Prebuilt
Custom
Switches the local audio or video input device during a call. You can specify a device by its ID (from enumerateDevices()) or provide a raw MediaStreamTrack directly.
This is a convenience wrapper around updateInputSettings() for device switching — it emits an input-settings-updated event on success.
Parameters
string— ID of the audio input device to use, as returned byenumerateDevices()false— locally locks the mic off (see note below)null— no-op; no change is made
MediaStreamTrack— use this track directly as the audio input, bypassing device selectionfalse— locally locks the mic off (see note below)
audioDeviceId.string— ID of the video input device to use, as returned byenumerateDevices()false— locally locks the camera off (see note below)null— no-op; no change is made
MediaStreamTrack— use this track directly as the video input, bypassing device selectionfalse— locally locks the camera off (see note below)
videoDeviceId.Locally locking a device offPassing
false is distinct from calling setLocalAudio(false) or setLocalVideo(false). Those mute the track — it can be re-enabled. Passing false here prevents Daily from acquiring or re-acquiring the track entirely. setLocalAudio(true) / setLocalVideo(true) will have no effect until you pass a device ID, a MediaStreamTrack, or true back.This is a local-only restriction — the server has no knowledge of it. Use it to enforce device policy in your UI without relying on server-side permissions.Return value
Returns aPromise<DailyDeviceInfos> with the active camera, mic, and speaker. Fields will be an empty object {} if the device is unspecified, unacquired, or replaced by a custom track.