Using front camera as default
sigvevermandere opened this issue · 6 comments
Description of the bug
Using the preferredCamera
argument in TakePicture
doesn't seem to work. If I set it to PreferredCamera.Front
, it still opens the rear camera.
Reproduction steps
Run the following line:
NativeCamera.TakePicture((string imagePath) => { Debug.Log(imagePath); }, -1, true, NativeCamera.PreferredCamera.Front);
This should still open the rear camera.
Platform specs
- Unity version: 2020.2.0b2.3094
- Platform: Android
- Device: OnePlus Nord Android 11
- How did you download the plugin: Package Manager
I can also reproduce this issue on some devices but unfortunately, this issue can't be resolved. There is no official way to set the camera direction while launching the native camera app on Android. I'm using all known unofficial methods to set the camera direction but looks like it just doesn't work on all native camera apps.
hmm, okay. Thanks for your quick reply!
Are there any updates on this? Even using NativeCamera.PreferredCamera.Rear
I get the front camera on a Samsung S22 Ultra
To my knowledge, there are no updates regarding this issue.
Thank you for the quick reply, that's really unfortunate though :(
Do you know if there is any other way to get a decent camera picture (I just need a single picture) from inside unity for an Android device? What I tried so far is:
- Using Unity API to access the camera directly. Unfortunately the picture quality taking a snap like this is really bad, there is a lot of motion blur and the color are very bad.
- Using Unity AR Foundation. But the app become very heavy and additionally AR Foundation is not supported on all the recent phones as far as I know (at least there is a list of compatible device, so I guess there must be some incompatible ones even among recent devices).
I don't remember seeing free solutions unfortunately. I had seen NatDevice in the past but it's a paid solution.