Accessing the camera using the Camera API
The Camera API provides access to the device's camera application using the Camera plugin identified by the cordova-plugin-camera
key. With this plugin installed, an app can take a picture or gain access to a media file stored in the photo library and albums that the user created on the device. The Camera API exposes the following two methods defined in the navigator.camera
object:
getPicture
: This opens the default camera application or allows the user to browse the media library, depending on the options specified in theconfiguration
object that the method accepts as an argumentcleanup
: This cleans up any intermediate photo file available in the temporary storage location (supported only on iOS)
As arguments, the getPicture
method accepts a success handler, failure handler, and optionally an object used to specify several camera options through its properties as follows:
quality
: This is a number between0
and100
used to specify the quality of...