CameraRecording
A video a Camera recorded, as an MPEG-4 file in the cache with its length.
Verwendung
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>
</>
);
}Typdeklaration
export type CameraRecording = SpecCameraRecording;Mitglieder 2
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
uri | string | Ja | An MPEG-4 video in the app's cache directory (file://). |
duration | number | Ja | Seconds. |
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.