Search code examples
cordovapluginscameraphonegap-plugins

Phonegap :difference between capture.captureImage and camera.getPicture


I am trying to create a phonegap app to capture image with its camera. When i googled, i got two options ie using camera api and capture api.

what is the difference between navigator.device.capture.captureImage(captureSuccess, captureError, options) and navigator.device.camera.getPicture(captureSuccess, captureError, options)


Solution

  • I noticed one difference.

    navigator.device.capture.captureImage(captureSuccess, captureError, options) on success save the image to default camera location where as navigator.device.camera.getPicture(captureSuccess, captureError, options) on success returns image as Base64 string

    using navigator.device.capture we can also capture other media like audio(navigator.device.capture.captureAudio(captureSuccess, captureError, {limit: 1})) and video (navigator.device.capture.captureVideo(captureSuccess, captureError, {limit: 1})) which alse on success,saved to default location