CameraRecording
A video a Camera recorded, as an MPEG-4 file in the cache with its length.
Usage
Save the result of recording a video.
// Save the result of recording a video.
import { Button, Camera, cameraRef, fileSystem, type CameraRecording } from 'kuito';
async function keep(video: CameraRecording) {
// Recordings land in the cache, which the system may clear: move the keepers.
const to = `${fileSystem.documents}clip-${Date.now()}.mp4`;
await fileSystem.move(video.uri, to);
return to;
}
function Recorder() {
const camera = cameraRef();
return (
<>
<Camera ref={camera} mode="video" flex={1} />
<Button onPress={() => void camera.current?.startRecording().then(keep)}>Record</Button>
<Button onPress={() => void camera.current?.stopRecording()}>Stop</Button>
</>
);
}Type declaration
export type CameraRecording = SpecCameraRecording;Members 2
| Name | Type | Required | Description |
|---|---|---|---|
uri | string | Yes | An MPEG-4 video in the app's cache directory (file://). |
duration | number | Yes | Seconds. |
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.