-
-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
The current library works great. However, when put in landscape the highlights are a bit mess. Do you have any suggestion?

export const CameraCapture = ({ onBarcodeScanned }: ICameraCaptureProps) => {
const handleBarcodeScanned = Worklets.createRunOnJS(onBarcodeScanned);
const { props: cameraProps, highlights } = useBarcodeScanner({
fps: 5,
onBarcodeScanned: (barcodes) => {
'worklet';
const barcodesData: string[] = barcodes.map(({ value }) => value || '');
handleBarcodeScanned(barcodesData);
},
});
const styles = useStyles(cameraStyles);
const devices = useCameraDevices();
const device = devices.find(({ position }) => position === 'back');
const format = useCameraFormat(device, [
{ videoResolution: { width: 1920, height: 1080 } },
]);
if (!device) {
return null;
}
return (
<>
<Camera
style={styles.camera}
device={device}
isActive
enableZoomGesture={true}
{...cameraProps}
format={format}
/>
<CameraHighlights highlights={highlights} color="peachpuff" />
</>
);
};
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels