cameraRef
Makes a CameraRef while a component sets up: a Camera ref whose ready and error signals follow the view's events.
Usage
Configure video capture.
// Configure video capture.
import { Button, Camera, cameraRef, type RecordingOptions } from 'kuito';
// A clip stops on its own after 15 seconds.
const clip: RecordingOptions = { maxDuration: 15 };
function Clip() {
const camera = cameraRef();
const record = async () => {
const video = await camera.current?.startRecording(clip);
console.log(video?.uri, video?.duration);
};
return (
<>
<Camera ref={camera} mode="video" flex={1} />
<Button onPress={record}>Record</Button>
</>
);
}Signatures
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.