cordova-plugin-camera

cordova-plugin-camera

This plugin defines a global navigator.camera object, which provides an API for taking pictures and for choosing images from the system's image library.

Although the object is attached to the global scoped navigator, it is not available until after the deviceready event.

document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
    console.log(navigator.camera);
}

Installation

This requires cordova 5.0+

cordova plugin add cordova-plugin-camera

Older versions of cordova can still install via the deprecated id

cordova plugin add org.apache.cordova.camera

It is also possible to install via repo url directly ( unstable )

cordova plugin add https://github.com/apache/cordova-plug