Unify Applications
Logo
Camera, Scanner & Barcode

Camera, Scanner & Barcode

Logo

11 mins READ

Capture photos and video, scan barcodes and QR codes through the camera, or render scannable barcodes from your data.

This page compares the five blocks. Each one is covered in full on its own page: Camera & Photo Booth and QR Code, Barcode & Scanner.

unify-applications-camera-scanner-and-barcode-01-scanner-block.png
unify-applications-camera-scanner-and-barcode-01-scanner-block.png

Choosing the Right Block

Block

Purpose

Platform

Camera

Live feed photo capture and video recording. Supports Face Detection (web) and Recording add-ons.

Web + Native mobile

Photo Booth

Richer mobile capture experience with crop, drawing, flash, and gallery. Designed for native mobile apps.

Native mobile only

Scanner

Decode barcodes and QR codes from the camera feed. Accumulates decoded values in a data array.

Web + Native mobile

Barcode

Render a scannable barcode graphic from a text value. Display-only — no camera, no scanning.

Web

File Upload

Pick existing files from the device (no camera). See File Upload.

Web + Native mobile

Where to Find Each Block's Properties

Properties, add-ons, events, methods and exposed state for each block are on its detail page:

Common Gotchas

Photo Booth is native mobile only

The Photo Booth block is not available in web apps. It does not appear in the web block library and a page using it has no web fallback. For web photo capture, use the Camera block instead.

switchCamera always toggles — it ignores the facingMode parameter

Both Camera and Photo Booth expose a switchCamera method that takes a facingMode parameter in its UI, but both blocks ignore the parameter and simply toggle to whichever camera is not currently active. Call it twice and you're back where you started.

Face detection and recording are mutually exclusive on Camera

If the Recording add-on has Auto Record, Duration, Loop, or Loop Iterations set, face detection stops working even when its toggle is on. Recording wins. Choose one capability per Camera block.

On Photo Capture fires after upload, not at the shutter press

For both Camera and Photo Booth, the event fires after the upload completes, not when the shutter is pressed. previewImage / previewMedia updates immediately at capture time, but use the event and the uploadedImage / uploadedMedia state for anything that needs the real backend URL.

Barcode keeps the last valid barcode for invalid or empty text

If the Text doesn't satisfy the selected format's rules — for example letters in an EAN13 that needs only digits — no error is shown. The block keeps displaying whatever it last rendered successfully, or stays blank. Validate bound values upstream when the format is strict.

On Permission Denied does not fire in the Photo Booth native runtime

A camera-permission refusal updates hasCameraPermission to false and shows an access-denied panel, but the On Permission Denied event handler is not invoked on native. Watch {{ id.hasCameraPermission }} instead of relying on the event for Photo Booth on mobile.

FAQs

Can I use the Camera block to scan barcodes?

The Camera block is designed for photo and video capture — it does not decode barcodes or QR codes. Use the Scanner block for barcode and QR code reading. The Scanner and Camera blocks share camera hardware but serve entirely different purposes.

How do I save each clip from a looped recording session?

When the Camera block is set up with Loop, each completed clip fires On Recorded File Capture. At that point {{ id.recordedVideoFile }} holds the just-finished clip. Wire that event to a "save file to record" action — each iteration fires separately, so your action runs once per clip. If you need all clips together, push each recordedVideoFile into a page variable array from within the event handler.

Why does my Scanner not detect a barcode that I can scan with a phone camera?

The Scanner block only decodes formats in its supported list, which differs between web and native. On mobile, UPC-A, UPC-E, and ITF formats are not supported — codes in those formats are silently ignored. Verify the barcode's format against the platform's supported list. Also confirm the code falls clearly within the framed scan region; codes outside the region are not read.

Can I pre-fill the Barcode block with data from my database?

Yes. Bind the Text property to any expression — a table row's ID, a query result field, a variable. The barcode re-renders reactively whenever the bound value changes. If the value is empty or invalid for the format, the block keeps showing the last barcode it drew (or stays blank if none). Validate bound values upstream.

When should I use Photo Booth vs. Camera block on a mobile app?

Use Photo Booth when you need video, crop, annotation/drawing, flash control, or gallery picking as part of the capture flow — it provides a full guided capture UI. In mobile apps the Camera block captures photos only: recording produces no clip, and On Permission Denied and On Face Detected don't fire. Use Camera for photo capture when you are building for both web and mobile with one shared block, and for Face Detection, auto-record, recording loops and method-triggered recording on web.