CameraViewProps
interface CameraViewProps extends CameraProps, PickProps 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
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
device
device:
| CameraDevice
| CameraPositionThe CameraDevice to open, or a CameraPosition
(e.g. 'back') to auto-pick a matching device via
getCameraDevice(...).
See
Inherited from
enableDistortionCorrection?
optional enableDistortionCorrection: booleanIf true, geometric distortion at the edges (e.g. on ultra-wide-angle
cameras) is corrected, at the cost of a small amount of field of view.
See
CameraControllerConfiguration.enableDistortionCorrection
Default
trueInherited from
CameraProps.enableDistortionCorrection
enableLowLightBoost?
optional enableLowLightBoost: booleanIf true, the Camera pipeline may extend exposure times (effectively
dropping frame rate) in low-light scenes to receive more light.
See
CameraControllerConfiguration.enableLowLightBoost
Default
falseInherited from
CameraProps.enableLowLightBoost
enableNativeTapToFocusGesture?
optional enableNativeTapToFocusGesture: booleanEnables (or disables) the native tap-to-focus gesture.
Default
falseenableNativeZoomGesture?
optional enableNativeZoomGesture: booleanEnables (or disables) the native pinch-to-zoom gesture.
Throws
If this property is enabled and zoom is not undefined.
Default
falseenableSmoothAutoFocus?
optional enableSmoothAutoFocus: booleanIf true, auto-focus transitions are performed slower and smoother
to appear less intrusive in video recordings.
See
CameraControllerConfiguration.enableSmoothAutoFocus
Default
falseInherited from
CameraProps.enableSmoothAutoFocus
exposure?
optional exposure:
| number
| SharedValue<number>Sets the exposureBias value.
You can also manually set the exposure bias via
setExposureBias(...).
Note
This property can be animated via Reanimated by passing a SharedValue.
Default
0getInitialExposureBias()?
optional getInitialExposureBias: () => number | undefinedA 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 | undefinedA 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
implementationMode?
optional implementationMode: PreviewImplementationModeSets the PreviewImplementationMode for the PreviewView.
Default
'performance'Inherited from
PreviewViewProps.implementationMode
isActive
isActive: booleanStarts the CameraSession when set to true, and stops it
when set back to false.
See
Inherited from
mirrorMode?
optional mirrorMode: MirrorModeSets whether the CameraOutputs are mirrored along
the vertical axis. 'auto' mirrors
automatically on selfie cameras.
See
CameraOutputConfiguration.mirrorMode
Default
'auto'Inherited from
onConfigured()?
optional onConfigured: () => voidCalled 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
onError()?
optional onError: (error: Error) => voidCalled whenever the CameraSession
has encountered an error.
See
CameraSession.addOnErrorListener
Inherited from
onInterruptionEnded()?
optional onInterruptionEnded: () => voidCalled 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) => voidCalled whenever the CameraSession
has encountered an interruption of the given
InterruptionReason.
Interruptions are temporarily.
See
CameraSession.addOnInterruptionStartedListener
Inherited from
CameraProps.onInterruptionStarted
onPreviewStarted()?
optional onPreviewStarted: () => voidCalled when the Camera's Preview
received its first Frame.
onPreviewStopped()?
optional onPreviewStopped: () => voidCalled when the Camera's Preview
stopped streaming Frames.
onSessionConfigSelected()?
optional onSessionConfigSelected: (config: CameraSessionConfig) => voidCalled once the given constraints have been fully resolved
into a concrete CameraSessionConfig.
See
CameraSessionConnection.onSessionConfigSelected
Inherited from
CameraProps.onSessionConfigSelected
onStarted()?
optional onStarted: () => voidCalled when the CameraSession
has been started.
See
CameraSession.addOnStartedListener
Inherited from
onStopped()?
optional onStopped: () => voidCalled when the CameraSession
has been stopped.
See
CameraSession.addOnStoppedListener
Inherited from
onSubjectAreaChanged()?
optional onSubjectAreaChanged: () => voidCalled 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: OrientationSource | "custom"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
outputs?
optional outputs: CameraOutput[]The CameraOutputs the device will stream into.
See
Inherited from
ref?
optional ref: Ref<CameraRef>See
resizeMode?
optional resizeMode: PreviewResizeModeSets the PreviewResizeMode for the PreviewView.
Default
'cover'Inherited from
torchMode?
optional torchMode: TorchModeSets the torchMode value.
Default
'off'zoom?
optional zoom:
| number
| SharedValue<number>Sets the zoom value.
You can also manually set zoom via
setZoom(...).
Note
This property can be animated via Reanimated by passing a SharedValue.
Throws
If this property is set and enableNativeZoomGesture is enabled.
Default
1