Camera
The Camera widget is a surface that shows a live preview from the device camera on screen.
Control photo capture, video recording, flash, zoom, focus, exposure, and more from a script.
Definition and role
The Camera widget renders a live preview from the device camera. On the editing screen (design mode) it shows a placeholder; run the app and the real camera preview appears. Set the lens direction, resolution, audio, flash, and capture mode as properties, and control capture, recording, and saving from a script.
- Category: Contents
- Default size: fill width × height 200
- Default capture button visibility: off (
showCaptureButton = false)
Features
| Feature | Description |
|---|---|
| Live preview | Shows the device camera feed on screen in real time. (While the app runs) |
| Photo capture | Takes a photo with the current camera. Trigger it from the built-in capture button or from a script. |
| Video recording | Starts, stops, pauses, and resumes video recording. |
| Camera settings | Sets the lens direction, resolution, audio, flash, and capture mode as properties. |
| Camera control | Adjusts zoom, focus, exposure, and capture orientation lock from a script. |
| Save to gallery | Saves captured files or base64 images to the device gallery. |
How to use
- Open the Contents category in the left widget palette.
- Drag and drop the Camera item onto the canvas.
- In the Properties panel on the right, set the lens direction (
lensFacing), resolution (resolutionPreset), capture mode (captureMode), and more. - To use the built-in capture button, turn on
showCaptureButton. - Run the app to see the real camera preview. (The editing screen shows only a placeholder.)
Properties
| Property | Description | Default | Values / type |
|---|---|---|---|
lensFacing | Camera lens direction to use | back (rear) | back, front |
resolutionPreset | Preview and capture resolution | high | low, medium, high, veryHigh, ultraHigh, max |
enableAudio | Whether to include audio when recording video | On (true) | true / false |
initialFlashMode | Initial flash mode | off | off, auto, always, torch |
captureMode | Capture mode | photo | photo, video |
showCaptureButton | Whether to show the built-in capture button over the preview | Off (false) | true / false |
Notes and tips
The real camera preview appears only when the app runs on a physical device. On the editing screen (design mode), you see just a placeholder with a camera icon and a short message.
Camera and storage permissions are required. On Android, saving photos and videos to the gallery requires the photo (or storage) permission.
Learn more
For the complete Widget Control (Property, Method, and Event) reference for scripting this widget, see Camera Widget Control.