ionic 4 cordova-plugin-camera default FRONT camera not Working on android

1.2k views Asked by At

I am using this CameraOptions

private optionsCamera: CameraOptions = {
    quality: 50,
    saveToPhotoAlbum: false,
    correctOrientation:true,
    allowEdit: true,
    targetWidth:1024,
    targetHeight:1024,
    sourceType: this.camera.PictureSourceType.CAMERA,
    cameraDirection: this.camera.Direction.FRONT, // also i use Numbers also "1"
    destinationType: this.camera.DestinationType.DATA_URL,
    encodingType: this.camera.EncodingType.PNG,
    mediaType: this.camera.MediaType.PICTURE,    
}

but after build still android open a back camera only

Kindly help me for alternative camera plugin (default front camera) or fix this bug for ionic 4

1

There are 1 answers

2
Mohammad Reza Mrg On

from document:

CameraOptions Errata

Android Quirks

Any cameraDirection value results in a back-facing photo. (= You can only use the back camera)

https://github.com/apache/cordova-plugin-camera#android-quirks-1