Camera
This page describes the properties of the camera widget, which is used for capturing images and videos.
Content properties
These properties are customizable options present in the property pane of the widget, allowing users to modify the widget according to their preferences.
General
Mode button
Toggles the camera between Image and Video mode.
Visible boolean
Controls the visibility of the widget. If you turn off this property, the widget is not visible in View mode. Additionally, you can use JavaScript by clicking on JS next to the Visible property to control the widget's visibility conditionally.
Example: If you want to make the widget visible only when the user checks an item in a Checkbox widget, you can use the following JavaScript expression in the visible property of the Camera widget:
{{Checkbox1.isChecked}}
Disabled boolean
Prevents users from selecting the widget. Even though the widget remains visible, user input is not permitted. Additionally, you can use JavaScript by clicking on JS next to the Disabled
property to control the widget's disabled state conditionally.
For example, if you want to allow only a specific user to interact with the Camera widget, you can use the following JavaScript expression:
{{appsmith.user.email=="john@appsmith.com"?false:true}}
Mirrored boolean
Enabling this property mirrors the camera preview and the resulting captured image or video. Additionally, you can use JavaScript by clicking on JS next to the Mirrored
property to control the mirroring conditionally.
Events
When an event is triggered, these event handlers can execute queries, JS code, or other supported actions.
onImageSave
Triggered when the user captures an image. This event is only available when the camera widget is in Image mode.