CaptureControls
Properties
cancelRecording
cancelRecording: (() => void) | null;Discard the current audio recording without saving. (Audio mode only)
completedProtections
completedProtections: number;Number of captured assets successfully protected by the SDK.
enqueueProtection
enqueueProtection: (captureId, blob, sensorSnapshot, features?) => void;Manually enqueue a blob for protection (for deferred flows like plate confirmation).
Parameters
| Parameter | Type |
|---|---|
captureId | string |
blob | Blob |
sensorSnapshot | SensorSnapshot |
features? | Features |
Returns
void
error
error:
| {
message: string;
name: string;
}
| null;Any error encountered during camera or audio initialization.
facing
facing: Facing;Current active camera facing ("user" or "environment").
failures
failures: ProtectionQueueItem[];Snapshots of any protection operations that failed.
isAllProtected
isAllProtected: boolean;true when all captured assets have finished the protection pipeline.
isCapturing
isCapturing: boolean;true if a photo capture operation is currently in flight.
isInitialized
isInitialized: boolean;true when the audio engine has initialized and is ready to record (Audio mode only).
locationPermissionStatus
locationPermissionStatus: "error" | "unknown" | "granted" | "denied";Current location permission status from the sensor collector.
pendingProtections
pendingProtections: number;Number of captured assets currently waiting in the protection queue.
permissionStatus
permissionStatus: PermissionStatus;Current permission status for the camera (Image mode only).
previewRef
previewRef: RefObject<HTMLVideoElement | null>;Attach to a <video> element to render the live camera preview.
recordingDuration
recordingDuration: number;Length of the current audio recording in seconds.
recordingState
recordingState: RecordingState;Current state of the audio engine ("idle", "recording", "paused", "processing").
requestLocationPermission
requestLocationPermission: () => Promise<void>;Request location permission (triggers browser prompt, updates status).
Returns
Promise<void>
requestPermissions
requestPermissions: () => Promise<void>;Request permission and initialize the camera manually (Image mode only).
Returns
Promise<void>
setCameraData
setCameraData: (data) => void;Set per-capture camera data (e.g., from EXIF) in onCapture.
Auto-enqueue picks this up for the current capture.
Parameters
| Parameter | Type |
|---|---|
data | CameraSettings | undefined |
Returns
void
setOrientation
setOrientation: (degrees) => void;Manually override the device orientation angle (0, 90, 180, 270) for capture EXIF.
Parameters
| Parameter | Type |
|---|---|
degrees | number |
Returns
void
setZoom
setZoom: (value) => void;Apply a new digital zoom level within the supported zoomRange.
Parameters
| Parameter | Type |
|---|---|
value | number |
Returns
void
startRecording
startRecording: (() => Promise<boolean>) | null;Begin recording audio. (Audio mode only)
Returns
true if recording started successfully.
stop
stop: () => void;Stop the camera and release hardware resources (Image mode only). For audio, use cancelRecording.
Returns
void
stopRecording
stopRecording: (() => Promise<void>) | null;Stop recording audio, fire onCapture, and queue for protection. (Audio mode only)
stream
stream: MediaStream | null;The underlying MediaStream from the camera or microphone.
takePicture
takePicture: () => Promise<void>;Capture a photo from the live video stream.
Fires onCapture immediately and queues the asset for protection.
Returns
Promise<void>
toggleFacing
toggleFacing: () => void;Toggle between front and rear cameras.
Returns
void
zoom
zoom: number;Current digital zoom level (1.0 = baseline).
zoomRange
zoomRange: ZoomRange;Minimum, maximum, and step size for digital zoom on the active camera.