Force to open back camera on iPhone

Tags: ,

I have this in my html5

<input name="photoAutomatic" id="automatic" type="file" capture="user" accept="image/jpeg" class="btn btn-primary mb-2 d-none"/>

but every time I click this input, it uses the front selfie camera. How can I set it so that it uses the back cam instead?

I’m using html5 + php


Change capture="user" to capture="environment".

Alternatively, simply don’t set the capture attribute’s value. It’s often best to just leave these things up to the system default. Usually, the back-facing/environment camera would be used by default.

Source: stackoverflow