1

I am trying to capture images from mobile devices directly, using HTML5 file capture tag. I don't want to allow users browsing library to upload existing images. I want them to just capture and upload them. The file capture tag works well with Android devices, but in iOS its allowing to browse the library. Is there any way to prevent this, and access the camera directly? Thanks in advance.

shanish
  • 1,964
  • 12
  • 35
  • 62

1 Answers1

1

Is there any way to prevent this, and access the camera directly?

Yes there is but only on iOS 10.3+.

Use <input type="file" name="video" accept="video/*" capture>

The capture boolean attribute indicates capture directly from the camera is preferred and it is supported by Android and Safari but only on iOS 10.3+.

See Correct Syntax for HTML Media Capture and https://stackoverflow.com/a/43737156/813988

octavn
  • 3,154
  • 32
  • 49