A plugin that enables an application to access the camera features of the user’s device. This plugin allows the implementation of actions for taking pictures or choosing images from the device gallery.
Create your own Logic
To allow users to take a picture and use it on the application with the camera's device, use the TakePicture client action in a suitable Logic Flow (see Documentation tab). If a picture is successfully taken, it will be available in binary on the Output Parameter ImageCaptured. When using the TakePicture client action you can change image quality parameters such as quality, size, and encoding type to best suit your needs.
You can also use the ChooseGalleryPicture client action to allow users to choose an image from their device and use it on the application. If an image is successfully selected, it will be available in binary on the Output Parameter ImageChosen.
Using Accelerators
You can use the TakePicture block included in the plugin. To correctly implement the TakePicture block, drag and drop it on the screen, define a handler action, and assign its Output Parameter to a Local Variable.
To enable the Choose Image feature included in the plugin, follow the same process using the ChooseImage block.
Use the dropdown on the Download button at the top of the page to test our demo app called CameraDemoApp. You’ll be able to see an example of how the current version of the Camera Plugin is implemented, and access a menu where you can change and try out different settings.
The latest version of Camera Plugin is compatible with the supported MABS versions available:
MABS 9.0
MABS 8.0
MABS 7.0
MABS 6.3
Starting from version 6.0.0, this plugin can be used in web browsers and Progressive Web Apps (PWAs).
In PWA, taking multiple pictures requires use of the browser stream capabilities. To ensure the app has access to the stream, add the theme CameraPlugin as an element to your app.
To edit pictures, make sure you import the theme CameraPlugin as a dependency.
Keep the theme as dependency even when the IDE reports it as not used by the app.
You can check the supported devices and browser versions here.
In some devices, taking multiple pictures shows a defective UI. There is, currently, no workaround to this issue.
In some Chrome versions, the image appears rotated when displayed using an image widget.
In iOS 13.2 and 13.3, the camera may stop working due to the WebKit 206219 bug. If the camera stops working, swipe up the app in App Switcher and reopen the app. WebKit is working on the fix.
Camera plugin for Apache Cordova
Apache License 2.0
Copyright 2012 The Apache Software Foundation
Cropper.js
The MIT License (MIT)
Copyright 2015-present Chen Fengyuan