Android cordova camera cancelled
Asked Answered
G

0

6

I'm building an app with Ionic and ngCordova but I have an issue with the camera.

When I try to take a picture, I have a "camera cancelled" error, before taking the picture. That's not all the time. If I insist sometimes I have a result. I looked for an answer but I can't resolve it.

I have an Android 4.4.4.

And I have a "selection cancelled" if I select this source mode.

Here is my code:

var options = {
    quality: 75,
    destinationType: Camera.DestinationType.DATA_URL,
    sourceType: Camera.PictureSourceType.CAMERA,
    allowEdit: true,
    encodingType: Camera.EncodingType.JPEG,
    popoverOptions: CameraPopoverOptions,
    targetWidth: 300,
    targetHeight: 300,
    saveToPhotoAlbum: false
};
$cordovaCamera.getPicture(options).then(function(imageData) {
    console.log(imageData);
}, function(error) {
    console.log(error);
});
Git answered 3/11, 2015 at 22:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.