Skip to main content
Version: 0.2.4

Interface: CameraProps

CameraView.CameraProps

Properties for the camera.

<Camera
onFrame={(image: Image) => {
image.release();
}}
hideCaptureButton={true}
/>

Hierarchy

  • ViewProps

    CameraProps

Properties

facing

Optional facing: CameraFacing

Direction the camera faces relative to the device's screen.


hideCaptureButton

Optional hideCaptureButton: boolean

Hides the capture button if set to true, otherwise the camera will show a capture button.


hideFlipButton

Optional hideFlipButton: boolean

Hides the flip button if set to true, otherwise the camera will show a flip button.


targetResolution

Optional targetResolution: TargetResolution

Camera target resolution. It is not guaranteed that the camera runs at the set target resolution, and it might pick the closest available resolution.

{@see https://developer.android.com/reference/androidx/camera/core/ImageAnalysis.Builder#setTargetResolution(android.util.Size)}

Methods

onCapture

Optional onCapture(image): void

Callback with an Image after capture button was pressed.

Parameters

NameTypeDescription
imageImageAn Image reference.

Returns

void


onFrame

Optional onFrame(image): void

Callback when the camera delivers an Image.

caution

Needs to call Image.release to receive the next frame. The camera preview will continue to render updates, but new Image frames will be omitted until Image.release is called.

Parameters

NameTypeDescription
imageImageAn Image reference.

Returns

void