Skip to content
Advertisement

Force to open back camera on iPhone

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

Advertisement

Answer

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

https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/capture

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.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement