HTML Media Capture - Upload Approach

Explanation on HTML Media Capture - Upload Approach

Adding the capture attribute without a value let's the browser decide which camera to use, while the "user" and "environment" values tell the browser to prefer the front and rear cameras, respectively.

Android users will no longer have the option of choosing an existing picture. The system camera app will be started directly.

The capture attribute works on Android and iOS, but is ignored on desktop.

Image Capture Code Block Examples

<input type="file" accept="image/*" capture>
<input type="file" accept="image/*" capture="user">
<input type="file" accept="image/*" capture="environment">

Last updated