**我正在使用这个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,
}
但是在构建后,android仅打开后置摄像头
**请为我提供替代相机插件(默认前置相机)或为ionic 4修复此错误**
定义选项,然后在构造函数或方法中使用它:
private const optionsCamera: CameraOptions = {
cameraDirection: 1
}
然后从构造函数或您想在任何地方动态设置值的方法:
this.optionsCamera.cameraDirection = this.camera.Direction.FRONT;