use-simple-camera
Version:
Production-ready React Hooks for Camera, Video Recording, QR/Barcode Scanning, Motion Detection, and Audio Analysis. Zero dependencies, fully typed, and easy to use.
17 lines (15 loc) • 544 B
TypeScript
import { VideoRecorderOptions } from '../types';
export declare const useRecorder: (stream: MediaStream | null) => {
isRecording: boolean;
isPaused: boolean;
recordedBlob: Blob | null;
startRecording: (options?: VideoRecorderOptions & {
onComplete?: (blob: Blob) => void;
mode?: "video-only" | "audio-only" | "both";
}) => void;
stopRecording: () => void;
pauseRecording: () => void;
resumeRecording: () => void;
takeSnapshot: () => Promise<Blob | null>;
clearRecordings: () => void;
};