Capture session lifecycle
Both FaceCaptureSession and FingerprintCaptureSession are EventEmitters with the same overall shape:
idle → initializing → ready → detecting → hold_steady → capturing → (quality_check) → completed
↘ retry → detecting
↘ errorYou call start(). The session opens the camera, runs detection, emits a 'guidance' event on every frame, fires 'captured' when a frame passes the gates, then 'completed'. Call stop() to tear down early.
Events
| Event | Fired by | Payload |
|---|---|---|
started | both | none |
state_change | both | FaceCaptureState | fingerprint state |
detection | both | FaceDetectionEvent | HandDetectionEvent |
guidance | both | GuidanceState |
face_quality | face | FaceQualityResult |
quality | fingerprint | QualityInfo |
quality_failed | fingerprint | QualityInfo |
antispoof | face | { score, passed } |
captured | both | per-modality result |
step_change | fingerprint | { index, step } |
completed | both | final result |
error | both | SladeIDError subclass |
stopped | both | none |
Reading the state
Wire 'guidance' to the UI for prompts (“hold steady”, “move closer”). Wire 'state_change' for higher-level UI changes (showing a countdown, swapping the overlay). Wire 'captured' and 'completed' for the success path; wire 'error' for the failure path.
Used in
- Every capture guide.
- Capture sessions reference.