Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cameraDirection property isnt working as suggested #919

Open
dylnmatthewswork opened this issue Dec 2, 2024 · 0 comments
Open

cameraDirection property isnt working as suggested #919

dylnmatthewswork opened this issue Dec 2, 2024 · 0 comments

Comments

@dylnmatthewswork
Copy link

Bug Report

Problem

What is expected to happen?

I expect the camera to always open using the back camera.

What does actually happen?

It opens upusing the front camera when minimizing the app and opening native camera app and switching to front camera.

When i come back to my app and open up the camera it uses the front camera instead of the back.

Information

If i leave the app and open up the camera app and put it on front option now my ionic app also uses the front option instead of defaulting to back camera

Command or Code

const options: CameraOptions = {
  quality: this.platform.is("ios") ? 60 : 70,
  destinationType: this.camera.DestinationType.DATA_URL,
  encodingType: this.camera.EncodingType.JPEG,
  mediaType: this.camera.MediaType.PICTURE,
  sourceType: sourceType,
  correctOrientation: true,
  saveToPhotoAlbum: imageSource === 'camera'? true: false,
  cameraDirection: this.camera.Direction.BACK
};

Environment, Platform, Device

Android

Version information

ionic 6
"cordova-plugin-camera": "^8.0.0",
Android Studio Ladybug | 2024.2.1 Patch 2
cordova -v
11.1.0

ionic info

Ionic:

Ionic CLI : 6.20.8 (C:\Users\xxx\AppData\Roaming\npm\node_modules@ionic\cli)
Ionic Framework : @ionic/angular 6.7.5
@angular-devkit/build-angular : 14.2.12
@angular-devkit/schematics : 14.2.12
@angular/cli : 14.2.12
@ionic/angular-toolkit : 6.1.0

Cordova:

Cordova CLI : 11.1.0
Cordova Platforms : android 13.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 16 other plugins)

Utility:

cordova-res : not installed globally
native-run : 1.7.2

System:

Android SDK Tools : 26.1.1 (C:\Users\xxx\AppData\Local\Android\Sdk)
NodeJS : v16.16.0 (C:\Program Files\nodejs\node.exe)
npm : 8.11.0
OS : Windows 10

Checklist

  • [x ] I searched for existing GitHub issues
  • [x ] I updated all Cordova tooling to most recent version
  • [x ] I included all the necessary information above
@dylnmatthewswork dylnmatthewswork changed the title cameraDirection propery isnt working as suggested cameraDirection property isnt working as suggested Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant