Reputation: 19
My current options for taking photos from an iPad camera in my Ionic/Cordova application are as follows:
const options: CameraOptions = {
quality: 70,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
correctOrientation: true,
cameraDirection: this.camera.Direction.FRONT
};
I read on the Cordova documentation that setting the property cameraDirection tells which camera you want to use when you take a picture on a device using your app. I set the direction to front, hoping this would mean that only front facing pictures would be accepted. Unfortunately, I am still able to switch to my back camera once the camera app is opened.
Is there a way to limit the camera to only being used by the front facing camera?
Upvotes: 1
Views: 524
Reputation: 2956
Short answer: Not with Cordova, because the Camera plugin uses a native camera from the device that always includes the rotation button. You can however create a custom camera plugin (in Java) to get rid of all buttons but this requires plenty of Java knowledge.
Upvotes: 0