cycleCamera(properties?)
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() and triggers an input-settings-updated event on success.
Parameters
Optional. When
true, prefers switching to a camera with a different facing mode (front ↔ rear). Defaults to false.Return value
Returns aPromise<{ device?: MediaDeviceInfo | null }> resolving with the newly active camera’s MediaDeviceInfo, or null if no device was found.