New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 870587 link

Starred by 3 users

Issue metadata

Status: Duplicate
Merged: issue 156382
Owner: ----
Closed: Aug 6
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 3
Type: Feature



Sign in to add a comment

<input type="file" accept="image/*"> should offer to take a photo with the camera (Desktop)

Project Member Reported by mgiuca@chromium.org, Aug 3

Issue description

Chrome Version: All
OS: All Desktop (Windows, Mac, Linux, Chrome OS)

What steps will reproduce the problem?
(1) Create an <input type="file" accept="image/*">.
(2) Click it.

Test code: https://codepen.io/anon/pen/WKJBVV

What is the expected result?
Offers to take a photo with the camera, or choose an image file.

What happens instead?
Just shows the normal file open dialog.

Note: This works on Android (and apparently iOS, according to this post [1]). There's no reason it shouldn't work on desktop, if the user has a camera connected.

https://developers.google.com/web/fundamentals/media/capturing-images/
 
Note: This is explicitly allowed by the standard:

https://html.spec.whatwg.org/multipage/input.html#attr-input-accept

"User agents may use the value of [the accept attribute] to display a more appropriate user interface than a generic file picker. For instance, given the value image/*, a user agent could offer the user the option of using a local camera or selecting a photograph from their photo collection."
It would certainly be useful if we used the capture attribute on desktop if we didn't want to go all the way on just using image/*
Status: Available (was: Untriaged)
Issue 156382 is relevant.

Makes this "Available", however DOM/HTML team has no bandwidth to handle this for a while.

Mergedinto: 156382
Status: Duplicate (was: Available)
Oh OK, I didn't realise this was actually specced (just in a different spec to HTML):

https://www.w3.org/TR/html-media-capture/

In that case, marking as duplicate.

Sign in to add a comment