4

There is no capture="camera" attribute for input type="file" tag in official w3.org documentation.

Ironically on so many places I found capture="camera" is used. Example here or here or here and so many other places.

Not a single tutorial with capture="user". Why is that?

Is there any major difference between capture="user" and capture="camera"?

Can you please also mention device compatibility for capture="user" and capture="camera"? I couldn't find it anywhere.

unor
  • 92,415
  • 26
  • 211
  • 360

2 Answers2

8

capture="camera" is deprecated in the HTML 5.1 spec.

The capture attributes keywords are user and environment which relate to front and rear facing cameras respectively.

In addition, there is a third state, the implementation-specific state.

The missing value default is the implementation-specific state. The invalid value default is also the implementation-specific state.

You can read more about it here

miknik
  • 5,748
  • 1
  • 10
  • 26
0

May be to take a picture using the device's user-facing camera,using an HTML form is

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

and by default/ normal care using camera to get picture using an HTML form is

<input type="file" accept="image/*" id="capture" capture="camera"> 
Omar Sohel
  • 164
  • 4