Skip to main content

CameraDevice

Represents a camera device discovered by the Camera.getAvailableCameraDevices() function

Properties​

devices​

• devices: PhysicalCameraDeviceType[]

The physical devices this CameraDevice contains.

  • If this camera device is a logical camera (combination of multiple physical cameras), there are multiple cameras in this array.
  • If this camera device is a physical camera, there is only a single element in this array.

You can check if the camera is a logical multi-camera by using the isMultiCam property.

Defined in​

CameraDevice.ts:199


formats​

• formats: CameraDeviceFormat[]

All available formats for this camera device. Use this to find the best format for your use case and set it to the Camera's Camera's .format property.

See the Camera Formats documentation for more information about Camera Formats.

Defined in​

CameraDevice.ts:253


hasFlash​

• hasFlash: boolean

Specifies whether this camera supports enabling flash for photo capture.

Defined in​

CameraDevice.ts:211


hasTorch​

• hasTorch: boolean

Specifies whether this camera supports continuously enabling the flash to act like a torch (flash with video capture)

Defined in​

CameraDevice.ts:215


id​

• id: string

The native ID of the camera device instance.

Defined in​

CameraDevice.ts:190


isMultiCam​

• isMultiCam: boolean

A property indicating whether the device is a virtual multi-camera consisting of multiple combined physical cameras.

Examples:

  • The Dual Camera, which supports seamlessly switching between a wide and telephoto camera while zooming and generating depth data from the disparities between the different points of view of the physical cameras.
  • The TrueDepth Camera, which generates depth data from disparities between a YUV camera and an Infrared camera pointed in the same direction.

Defined in​

CameraDevice.ts:223


maxZoom​

• maxZoom: number

Maximum available zoom factor (e.g. 128)

Defined in​

CameraDevice.ts:231


minZoom​

• minZoom: number

Minimum available zoom factor (e.g. 1)

Defined in​

CameraDevice.ts:227


name​

• name: string

A friendly localized name describing the camera.

Defined in​

CameraDevice.ts:207


neutralZoom​

• neutralZoom: number

The zoom factor where the camera is "neutral".

  • For single-physical cameras this property is always 1.0.
  • For multi cameras this property is a value between minZoom and maxZoom, where the camera is in wide-angle mode and hasn't switched to the ultra-wide-angle ("fish-eye") or telephoto camera yet.

Use this value as an initial value for the zoom property if you implement custom zoom. (e.g. reanimated shared value should be initially set to this value)

Example

const device = ...

const zoom = useSharedValue(device.neutralZoom) // <-- initial value so it doesn't start at ultra-wide
const cameraProps = useAnimatedProps(() => ({
zoom: zoom.value
}))

Defined in​

CameraDevice.ts:247


position​

• position: CameraPosition

Specifies the physical position of this camera. (back or front)

Defined in​

CameraDevice.ts:203


supportsDepthCapture​

• supportsDepthCapture: boolean

Whether this camera supports taking photos with depth data.

! Work in Progress !

Defined in​

CameraDevice.ts:273


supportsFocus​

• supportsFocus: boolean

Specifies whether this device supports focusing (Camera.focus(...))

Defined in​

CameraDevice.ts:283


supportsLowLightBoost​

• supportsLowLightBoost: boolean

Whether this camera device supports low light boost.

Defined in​

CameraDevice.ts:267


supportsParallelVideoProcessing​

• supportsParallelVideoProcessing: boolean

Whether this camera device supports using Video Recordings (video={true}) and Frame Processors (frameProcessor={...}) at the same time. See "The supportsParallelVideoProcessing prop" for more information.

If this property is false, you can only enable video or add a frameProcessor, but not both.

Defined in​

CameraDevice.ts:263


supportsRawCapture​

• supportsRawCapture: boolean

Whether this camera supports taking photos in RAW format

! Work in Progress !

Defined in​

CameraDevice.ts:279