CameraViewProps

interface CameraViewProps extends CameraProps, Pick

Props for the Camera component.

Extends CameraProps (the options for the underlying useCamera hook) with PreviewView-specific options and convenience props for gesture handling and animated values.

Properties

allowBackgroundAudioPlayback?

iOS
optional allowBackgroundAudioPlayback?: boolean

If enabled, the device may play background audio, possibly from another app (e.g. Apple Music) while the CameraSession is active.

If disabled (the default), any playing audio will be stopped while the CameraSession is active.

Note

If allowBackgroundAudioPlayback is true, background audio may also be captured in Video recordings.

Default

false

Inherited from

CameraSessionConfiguration.allowBackgroundAudioPlayback


allowHapticsAndSystemSoundsPlayback?

iOS
optional allowHapticsAndSystemSoundsPlayback?: boolean

If enabled, the device may play haptics/vibrations and system sounds during while the CameraSession is active.

If disabled (the default), all haptics and system sounds will be muted while the CameraSession is active.

Note

If allowHapticsAndSystemSoundsPlayback is true, haptics or system sounds may also be captured in Video recordings. Haptics may also affect stabilization or focus operations.

Default

false

Inherited from

CameraSessionConfiguration.allowHapticsAndSystemSoundsPlayback


constraints?

optional constraints?: Constraint[]

Constraints (e.g. { fps: 60 }) that the Camera pipeline will try to match when configuring the CameraSession.

See

CameraSessionConnection.constraints

Inherited from

CameraProps.constraints


device

The CameraDevice to open, or a CameraPosition (e.g. 'back') to auto-pick a matching device via getCameraDevice(...).

See

CameraSessionConnection.input

Inherited from

CameraProps.device


enableDistortionCorrection?

iOS
optional enableDistortionCorrection?: boolean

If set to true, the camera pipeline may correct areas of the image that may appear distorted - for example the edges of a ultra-wide-angle camera, at the cost of losing a small amount of field of view.

When enableDistortionCorrection is enabled and the camera pipeline applies a crop around the edges, the images will be upscaled to compensate for the artificial zoom - set enableDistortionCorrection to false if you want to avoid this overhead.

Throws

If the CameraDevice does not support distortion correction - see supportsDistortionCorrection.

Default

true

Inherited from

CameraControllerConfiguration.enableDistortionCorrection


enableLowLightBoost?

optional enableLowLightBoost?: boolean

Low light boost allows the Camera pipeline to automatically extend exposure times (and effectively drop frame rate) to receive more light, if necessary.

Throws

If the CameraDevice does not support low-light-boost - see supportsLowLightBoost.

Default

false

Inherited from

CameraControllerConfiguration.enableLowLightBoost


enableNativeTapToFocusGesture?

optional enableNativeTapToFocusGesture?: boolean

Enables (or disables) the native tap-to-focus gesture.

Default

false

enableNativeZoomGesture?

optional enableNativeZoomGesture?: boolean

Enables (or disables) the native pinch-to-zoom gesture.

Throws

If this property is enabled and zoom is not undefined.

Default

false

enableSmoothAutoFocus?

iOS
optional enableSmoothAutoFocus?: boolean

If set to true, auto-focus will switch between focus states much slower and smoother to appear less intrusive in video recordings.

Throws

If the CameraDevice does not support smooth auto focus - see supportsSmoothAutoFocus.

Default

false

Inherited from

CameraControllerConfiguration.enableSmoothAutoFocus


exposure?

optional exposure?: 
  | number
| SharedValue<number>

Sets the exposureBias value declaratively.

You can also imperatively set the exposure bias via setExposureBias(...).

Note

This property can be animated via Reanimated by passing a SharedValue.

Default

0

Inherited from

CameraProps.exposure


getInitialExposureBias?

optional getInitialExposureBias?: () => number | undefined

A getter for the initial exposure bias to apply when the CameraController is created. Later, the exposure bias can be adjusted via CameraController.setExposureBias(...).

See

CameraSessionConnection.initialExposureBias

Inherited from

CameraProps.getInitialExposureBias


getInitialZoom?

optional getInitialZoom?: () => number | undefined

A getter for the initial zoom value to apply when the CameraController is created. Later, the zoom can be adjusted via CameraController.setZoom(...).

See

CameraSessionConnection.initialZoom

Inherited from

CameraProps.getInitialZoom


implementationMode?

Android
optional implementationMode?: PreviewImplementationMode

Sets the PreviewImplementationMode for the PreviewView.

Default

'performance'

Inherited from

PreviewViewProps.implementationMode


isActive

isActive: boolean

Starts the CameraSession when set to true, and stops it when set back to false.

See

Inherited from

CameraProps.isActive


mirrorMode?

optional mirrorMode?: MirrorMode

Sets whether the CameraOutputs are mirrored along the vertical axis. 'auto' mirrors automatically on selfie cameras.

See

CameraOutputConfiguration.mirrorMode

Default

'auto'

Inherited from

CameraProps.mirrorMode


onConfigured?

optional onConfigured?: () => void

Called whenever the CameraSession has been configured with new connections via configure(...) and connections to the individual outputs are formed.

This is a good place to check output capabilities, such as CameraVideoOutput.getSupportedVideoCodecs()

Inherited from

CameraProps.onConfigured


onError?

optional onError?: (error: Error) => void

Called whenever the CameraSession has encountered an error.

See

CameraSession.addOnErrorListener

Inherited from

CameraProps.onError


onInterruptionEnded?

optional onInterruptionEnded?: () => void

Called when a previous interruption has ended and the CameraSession is running uninterrupted again.

See

CameraSession.addOnInterruptionEndedListener

Inherited from

CameraProps.onInterruptionEnded


onInterruptionStarted?

optional onInterruptionStarted?: (interruption: InterruptionReason) => void

Called whenever the CameraSession has encountered an interruption of the given InterruptionReason. Interruptions are temporarily.

See

CameraSession.addOnInterruptionStartedListener

Inherited from

CameraProps.onInterruptionStarted


onPreviewStarted?

optional onPreviewStarted?: () => void

Called when the Camera's Preview received its first Frame.


onPreviewStopped?

optional onPreviewStopped?: () => void

Called when the Camera's Preview stopped streaming Frames.


onSessionConfigSelected?

optional onSessionConfigSelected?: (config: CameraSessionConfig) => void

Called once the given constraints have been fully resolved into a concrete CameraSessionConfig.

See

CameraSessionConnection.onSessionConfigSelected

Inherited from

CameraProps.onSessionConfigSelected


onStarted?

optional onStarted?: () => void

Called when the CameraSession has been started.

See

CameraSession.addOnStartedListener

Inherited from

CameraProps.onStarted


onStopped?

optional onStopped?: () => void

Called when the CameraSession has been stopped.

See

CameraSession.addOnStoppedListener

Inherited from

CameraProps.onStopped


onSubjectAreaChanged?

optional onSubjectAreaChanged?: () => void

Called when the subject area substantially changes, e.g. when the user pans away from a scene that was previously in focus.

This is a good point to reset any locked AE/AF/AWB focus states back to continuously auto-focus.

See

CameraController.addSubjectAreaChangedListener

Inherited from

CameraProps.onSubjectAreaChanged


orientationSource?

optional orientationSource?: "custom" | OrientationSource

Set a desired OrientationSource for automatically applying CameraOrientation to all outputs, or 'custom' if you prefer to manually specify CameraOrientation yourself.

See

CameraOutput.outputOrientation

Inherited from

CameraProps.orientationSource


outputs?

optional outputs?: CameraOutput[]

The CameraOutputs the device will stream into.

See

Inherited from

CameraProps.outputs


ref?

optional ref?: Ref<CameraRef>

See

CameraRef


resizeMode?

optional resizeMode?: PreviewResizeMode

Sets the PreviewResizeMode for the PreviewView.

Default

'cover'

Inherited from

PreviewViewProps.resizeMode


torchMode?

optional torchMode?: TorchMode

Sets the torchMode value declaratively.

Default

'off'

Inherited from

CameraProps.torchMode


zoom?

optional zoom?: 
  | number
| SharedValue<number>

Sets the zoom value declaratively.

You can also imperatively set zoom via setZoom(...).

Note

This property can be animated via Reanimated by passing a SharedValue.

Default

1

Inherited from

CameraProps.zoom