ivpusic / react-native-image-crop-picker

iOS/Android image picker with support for camera, video, configurable compression, multiple images and cropping
MIT License
6.12k stars 1.56k forks source link

useFrontCamera is not working in android #1058

Open swaroopa94 opened 5 years ago

swaroopa94 commented 5 years ago

Version

Tell us which versions you are using:

Platform

Expected behaviour

when using useFrontCamera = true then when we use openCamera method then the front camera should be by default

Actual behaviour

But when we use that useFrontcamera=true in android the default camera is opening instead of front camera

Steps to reproduce

  1. install the module and link

  2. use openCamera method and give useFrontCamera property as true

  3. then in android when we run we can see the default back camera is opening

Attachments

`ImagePicker.openCamera({ mediaType: "video", useFrontCamera: true }) .then(image => { console.log("received image", image);

        })
        .catch(e => alert(e));`

Please anyone help me n solving this..

Thanks

a943999733 commented 5 years ago

I have the same problem. I hope I can get help.

andrey-tsaplin commented 5 years ago

This behavior relies on default camera application installed on device. Usually it installed by manufacturer. Some manufacturers doesn't properly handle camera facing parameter as it is not currently standardized on android.

As I see the only way to properly handle useFrontCamera parameter is to change plugin's approach to capture images by implementing camera functionality by it's own.

Anyway would be great to mention this unreliable behavior in docs.

andrey-tsaplin commented 5 years ago

Duplicate of #1029

umairalirehan commented 1 year ago

Make sure you added the following permissions for front camera in app/src/main/AndroidManifest.xml

<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.front" android:required="false" />

I did not add the useFrontCamera prop. Front camera is working automatically and running perfectly.

wolfxpertlab commented 1 year ago

some android mobile can not open front camera

Satyajeetsinh-9 commented 1 year ago

@ivpusic @andrey-tsaplin any update on this? i just want to open back camera by default. but even setting useFrontCamera to false did not work for me. if we have opened selfie camera in main camera it will open selfie first.

Luska066 commented 8 months ago

Do you remove this option "cropping:true", but the camera not has function of the crop

GeethuAnandM commented 7 months ago

i just want to open back camera by default. but even setting useFrontCamera to false did not work for me. if we have opened selfie camera in main camera it will open selfie first.