Open chandanpradhanin opened 3 weeks ago
Guten Tag, Hans here! 🍻
It looks like you are encountering an issue with ze front camera on your Xiaomi Redmi Note 8 Pro. From ze logs, it seems like ze device does not have a flash unit, which is correct; ze hasFlash
and hasTorch
properties are both false.
If you need ze flash for your selfies, perhaps you might consider using ze back camera instead, as it typically has a flash. If you are looking for assistance beyond this, please provide additional logs from adb logcat or any other debugging information to help mrousavy troubleshoot further!
Otherwise, it might be wise to check out ze Troubleshooting Guide in more detail. Also, if you wish for priority response, consider sponsoring the project here.
Keep up ze good work!
Note: If you think I made a mistake, please ping
@mrousavy
to take a look.
@mrousavy Thank you for your prompt response. As I do not intend to use a flash or torch while using the front camera, why is it still necessary that device.hasFlash and device.hasTorch be true? Also, I have used the torch={"off"} property, so why is this issue still occurring?
If you don't have a device you shouldn't render the Camera. This is literally what the error message says. Use Typescript, you cannot pass null to device
EDIT: Sorry I didn't read the whole issue - maybe it works when yoh pass torch={undefined}?
@mrousavy i am not passing null to device prop. I am passing the which is return by getCameraDevice(devices, 'front') and camera view is opened in my app but takePhoto function is not working for me. So i have changed in the options flash: 'off' like below and now its working for me.
const options = { base64: false, flash: 'off', skipMetadata: true };
let response = await this.camera.takePhoto(options);
What's happening?
The back camera is working for me, but I am experiencing this issue when using the front camera to take selfies. I am using getCameraDevice(devices, 'front') to obtain the front camera. I would appreciate your guidance in fixing this or letting me know if anything is incorrect.
Reproduceable Code
Relevant log output
Camera Device
Device
Xiaomi Redmi Note 8 Pro - M1906G71
VisionCamera Version
4.5.2
Can you reproduce this issue in the VisionCamera Example app?
Yes, I can reproduce the same issue in the Example app here
Additional information