0

Is there any way to have an option that allow choose if the user want to take a picture from the camera or using a stored image on some album using the same option?

For example, if i use this plugin (https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-camera/index.html), the option to see the stored images is disabled (See image). How to enable that?

enter image description here

  • Possible duplication of : [this](http://stackoverflow.com/questions/22450366/how-to-let-the-user-to-choose-from-gallery-or-take-picture-option-in-cordova?rq=1) which is also a duplication of [this](http://stackoverflow.com/questions/11852903/phonegap-give-user-option-of-picturesourcetype) – esQmo_ Apr 18 '17 at 23:17

1 Answers1

0

If you use this plugin. I would show the user a dialog and asking if they would like to use the gallery or camera.

Then you can change your options depending on the response. Example.

var source;

if(response=="gallery"){

    source = Camera.PictureSourceType.PHOTOLIBRARY;

} else {

    source = Camera.PictureSourceType.CAMERA;
}

navigator.camera.getPicture(onSuccess, onFail,
{
    sourceType: source
});
L Balsdon
  • 995
  • 8
  • 12