What the person is doing
The product wants to decode a QR or barcode from camera preview, a delegated OS scanner, a static image, or a pasted/manual code.
Foundation · lesson 6 of 15 · Cross-Device And Physical Interaction
Underlying principle: The same outcome may cross touch, camera, voice, keyboard, sensors, and offline moments. Design each transition as part of the task rather than a separate surface.
Provide a QR scan flow that starts from a deliberate user action, checks scanner support, explains camera use, guides alignment and lighting, decodes only supported formats, handles multiple, missing, invalid, duplicate, expired, and unsafe payloads, previews the decoded result before consequential action, offers scan-from-photo or manual-code fallback, and clears frames or secrets after the task.
The same outcome may cross touch, camera, voice, keyboard, sensors, and offline moments. Design each transition as part of the task rather than a separate surface.
The product wants to decode a QR or barcode from camera preview, a delegated OS scanner, a static image, or a pasted/manual code.
Provide a QR scan flow that starts from a deliberate user action, checks scanner support, explains camera use, guides alignment and lighting, decodes only supported formats, handles multiple, missing, invalid, duplicate, expired, and unsafe payloads, previews the decoded result before consequential action, offers scan-from-photo or manual-code fallback, and clears frames or secrets after the task.
Unsupported detector, missing scanner module, insecure context, or unsupported format state.
What decoded payload types are accepted, and what happens when the QR contains a URL, payment, credential, device token, ticket, or unknown text?
Scanning starts only after users choose a QR-dependent task and can see purpose, fallback, and privacy impact.
The product wants to decode a QR or barcode from camera preview, a delegated OS scanner, a static image, or a pasted/manual code.
Open the working example, try its controls, and compare the behavior against the decision guidance.
The product wants to decode a QR or barcode from camera preview, a delegated OS scanner, a static image, or a pasted/manual code.
Provide a QR scan flow that starts from a deliberate user action, checks scanner support, explains camera use, guides alignment and lighting, decodes only supported formats, handles multiple, missing, invalid, duplicate, expired, and unsafe payloads, previews the decoded result before consequential action, offers scan-from-photo or manual-code fallback, and clears frames or secrets after the task.
Unsupported detector, missing scanner module, insecure context, or unsupported format state.
The first decoded URL opens automatically and bypasses destination preview.
Label scan, torch, switch camera, choose photo, paste code, stop camera, retry, confirm, and cancel controls visibly and programmatically.
MDN Web Docs - checked
Supports secure-context barcode detection, limited browser availability, QR format support, detector construction, and image/video detection.
MDN Web Docs - checked
Supports BarcodeDetector interface behavior, supported format discovery, and detected barcode values.
Web Incubator Community Group - checked
Supports detected barcode raw values, bounding boxes, corner points, supported formats, and decode errors.
Google for Developers - checked
Supports Android custom QR scanning UI, barcode data extraction, supported formats, and performance guidance.
Google for Developers - checked
Supports delegated Android QR scanning without app camera permission, auto-zoom, and returned barcode objects.
Android Developers - checked
Supports Android OS-level QR scan entry points and payment handoff behavior.
MDN Web Docs - checked
Supports camera access states when web QR scanning uses live video.
MDN Web Docs - checked
Supports permission-state handling around camera access.
Source trail checked: