file icon indicating copy to clipboard operation
file copied to clipboard

Consider adding support for "capture" attribute

Open danabrams opened this issue 6 years ago • 4 comments

Input nodes on mobile browsers support a capture attribute that allows easy access to the camera and or microphone to take an image or make a short recording instead of a plain, old file-selector. Supporting this attribute would enable all sorts of cool mobile apps.

Here's a site with examples of each version: http://anssiko.github.io/html-media-capture/

On desktop browsers, it just defaults back to the regular file-picker. The inconsistency between mobile and desktop may absolutely be a reason not to do this.

Bringing this up because someone on Elm-slack specifically asked about how to capture images this way from a mobile browser, and the other way of doing it is a huge, painful workaround with a lot of port-side code.

danabrams avatar Feb 14 '19 13:02 danabrams

audio capturing via microphone works very different across mobile devices. mostly good on android devices (shows recorder) and do not work at all in iOS. Record Audio In HTML5

catz avatar Apr 02 '19 13:04 catz

@catz The link you've provided seems to mostly be about the media api. The capture attribute simply allows mobile devices to pull up their cameras instead of going to a file selector.

I did a test, but iOS doesn't have an audio capture interface, so capture brings it to the photo capture interface. It seems like support for this might have to be an attribute like imageCapture or videoCamera to exclude audio.

danabrams avatar Apr 05 '19 13:04 danabrams

From what I've seen, it would be a rather simple feature to implement. Can we hope for this feature to be shipped anytime soon?

Augustin82 avatar Dec 07 '20 10:12 Augustin82

I'd also love to see this implemented. Does anyone already have a version one can use as a replacement?

pmiddend avatar Mar 31 '22 13:03 pmiddend