> ## Documentation Index
> Fetch the complete documentation index at: https://docs.daily.co/llms.txt
> Use this file to discover all available pages before exploring further.

# cycleCamera()

> Switch the local camera to the next available device.

`cycleCamera(properties?)`

<Badge color="green">{"✓"} Prebuilt</Badge> <Badge color="green">{"✓"} Custom</Badge>

This is the simplest way to toggle between front and rear cameras on mobile. When doing so, pass `preferDifferentFacingMode: true` — without it, the method cycles through devices in list order, which may land on another camera with the same facing mode (common on newer iPhones that expose multiple rear cameras). Has no effect if only one camera is available.

This method is a wrapper around [`updateInputSettings()`](/reference/daily-js/instance-methods/update-input-settings) and triggers an [`input-settings-updated`](/reference/daily-js/events/settings-events#input-settings-updated) event on success.

## Parameters

<ParamField body="preferDifferentFacingMode" type="boolean">
  Optional. When `true`, prefers switching to a camera with a different facing mode (front ↔ rear). Defaults to `false`.
</ParamField>

## Return value

Returns a `Promise<{ device?: MediaDeviceInfo | null }>` resolving with the newly active camera's [`MediaDeviceInfo`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo), or `null` if no device was found.

## Example

```javascript theme={null}
// Toggle front/rear camera on mobile
await call.cycleCamera({ preferDifferentFacingMode: true });

// Cycle through all cameras in order
await call.cycleCamera();
```

## See also

<CardGroup>
  <Card title="Methods" icon="code" iconType="solid">
    * [cycleMic()](/reference/daily-js/instance-methods/cycle-mic)
    * [enumerateDevices()](/reference/daily-js/instance-methods/enumerate-devices)
    * [updateInputSettings()](/reference/daily-js/instance-methods/update-input-settings)
    * [getInputSettings()](/reference/daily-js/instance-methods/get-input-settings)
  </Card>

  <Card title="Events" icon="bolt" iconType="solid">
    * [input-settings-updated](/reference/daily-js/events/settings-events#input-settings-updated)
  </Card>

  <Card title="Guides" icon="book-open" iconType="solid">
    * [Audio and video](/docs/daily-js/guides/audio-video)
    * [Device permissions](/docs/daily-js/guides/device-permissions)
  </Card>
</CardGroup>
