Bug: input capture="camera" doesn't open camera
<input type="file" accept="image/*;capture=camera">
When clicking on this input, it doesn't open the camera of android device, it opens files browser instead.
Didn't found a way to fix it properly with all i read on stackoverflow and github.
Anyone has a simple solution ?
cf https://github.com/apache/cordova-plugin-camera/issues/489 and https://github.com/apache/cordova-android/issues/816 which are not exactly about camera capture, but default displayed browser, so different issues.
A workaround would be to use the cordova-plugin-camera APIs, although with this route, you'd probably want to build your own custom button instead of using the browser's <input> tag.
I believe this doesn't work because most of the input file attribute the native app actually needs to intercept and handle it explicitly. It's not "automatic" like the chrome browser. This could be a feature request, but there are some hurdles to jump through. Namely the requirement for apps to declare what features they use, including if they use the camera feature, which is something that the cordova-plugin-camera already does... and adding that into the core library is not really feasible imo.
@Aarbel found solution?
@WuglyakBolgoink yes i use the navigator.mediaDevices.getUserMedia API. It's not perfect, but it makes the job if you parse the medias, and select the one with "rear' and "back" in their names to get the device back camera.(in more details: navigator.mediaDevices API has an "environment" preference setting to select the back camera, but doesn't work well to select the right rear camera on all the devices (for example Microsoft Surface Devices), so it's necessary to list de media Devices and select the right ones you want.
Did anyone find a solution for this yet?