Open Bug 692955 (camera) Opened 13 years ago Updated 7 months ago

camera support for desktop <input accept=image/*> tag.

Categories

(Firefox :: General, defect)

defect

Tracking

()

People

(Reporter: fabrice, Assigned: fabrice)

References

(Depends on 2 open bugs, Blocks 1 open bug, )

Details

(Keywords: dev-doc-needed)

Attachments

(5 files, 10 obsolete files)

101.44 KB, image/png
Details
103.94 KB, image/png
Details
637 bytes, patch
Details | Diff | Splinter Review
23.78 KB, patch
Details | Diff | Splinter Review
39.06 KB, patch
Details | Diff | Splinter Review
This bug is about provide support for still image capture from a camera using the <input accept=image/*> tag.

We use the gips library from the webrtc project
Attached patch part 1: backend (obsolete) — Splinter Review
We create an async input stream that receives frames from gips.
Attached patch part 2: front-end (obsolete) — Splinter Review
Showing the capture picker in a tab-modal dialog.
Assignee: nobody → fabrice
These patches apply on top of the Alder project repository:
http://hg.mozilla.org/projects/alder
Is there a project/feature page for this? Also, you'll want to engage with UX to get a design for the front-end UI this adds.
From dup bug:
Taking photos is extremely privacy sensitive and can, when used without the user noticing, represent a surveillance device inside my house. I personally don't feel comfortable seeing this feature *at all* in Firefox.

But, assuming this is accepted: Given the tricks we've seen with <input type="file"> (ask Jesse Ruderman), please be sure to have explicit consent from the user, in form of a dialog box that cannot possibly be accidentally clicked nor the user tricked into clicking. Inline/inpage approval is not OK.

<sarcasm>We could even do a "authorization=police" parameter, which skips the user confirmation.</sarcasm>
Ben - see https://wiki.mozilla.org/Security/Discussions/WebRTC for the corollary to this bug - access to the camera/microphones for video and audio for WebRTC (and also for added security risk, screen-sharing).  Google has implemented much of this as Google Talk and Google+ Hangouts, and now Hangouts With Extras (which allows screen sharing).

Yes, this is *highly* security/privacy sensitive, and as part of this effort the IETF is looking at the security implications of the protocols and APIs (see ekr's draft from the above wiki page).
A nice way to do this is to have a request made to the user asking if you allow the loaded site to take a picture of you almost like the firefox's popup blocker.
Differences:
When you allow to be taken pictures, you allow the main page, not the frames.
Only the main page is allowed to take pictures. Any frames in it are always denied.
The page may request to take a picture whenever it wants but the picture is only taken when the user presses the <Enter> or the button to take the picture. That button is in a modal box made by the browser or the OS itself (like the file picker). The page has no control over that modal window.
Extra: The modal window should be useful for the user.
Allowing is by page load. Reloading a page means that the approval of allowing to take the picture is lost.
Keywords: dev-doc-needed
> A nice way to do this is to have a request made to the user asking if you
> allow the loaded site to take a picture of you almost like the firefox's popup blocker.
> The page has no control over that modal window.

+1

> when the user presses the <Enter>

That's subject to attacks (e.g. the "press enter game")
Attached patch part 1 : gips backend (obsolete) — Splinter Review
updated gips backend
Attachment #565664 - Attachment is obsolete: true
Attached patch part 2: capture picker UI (obsolete) — Splinter Review
Fixes an osx only bug
Attachment #565666 - Attachment is obsolete: true
Alias: camera
Blocks: 528886, webapi
Depends on: 700232
removing sec-review-needed and marking the feature page instead
Looks great! And good from privacy perspective.

I also like that I can take a file from disk instead.
(In reply to Fabrice Desré [:fabrice] from comment #17)
> Mockups from Jennifer:
> http://people.mozilla.com/~jboriss/specs/first_spec.png

These look really nice and very promising.

Suggestion: it is not uncommon for websites to want pictures with a specific aspect ratio. For instance, profile pictures may have to be square, or portrait 4x3. This is often supported either with direct truncation (where the server side just cuts the picture without asking the user) or with some in-page script that allows the user to select which area to use, within constraints. A lot of those script solutions are a bit heavy handed, and aren't always very accessible. Since I note that you are already considering a way of selecting an area in the picture, it could be useful to allow for a constrained aspect ratio mode. This could be specified by the page author using one of the markup hints that we're looking into.

Other non-UI hints could be useful, such as indicating which size boundaries the author wants so that the UA could provide an already-resized image. Such small additions could really help authors.
Depends on: 643692
Please, How I can to take a snapshot from a webcam in a desktop computer with Firefox?, What is the code supported?
(In reply to Junior from comment #20)
> Please, How I can to take a snapshot from a webcam in a desktop computer
> with Firefox?, What is the code supported?

when this lands in desktop Firefox, you will be able to do this via <input accept=image/*> on a webpage.
Added URL for fabrice's test (perhaps you should put the code here)
Attachment #585530 - Attachment is obsolete: true
Attachment #585531 - Attachment is obsolete: true
I pushed a couple of changes to alder:
http://hg.mozilla.org/projects/alder/rev/84616cd44046
http://hg.mozilla.org/projects/alder/rev/b25db6a3947e

With those changes, I was able to build with these patches applied and get working video capture on Windows.
Attachment #570795 - Attachment is obsolete: true
Attachment #586224 - Attachment is obsolete: true
Attachment #570797 - Attachment is obsolete: true
Attachment #590312 - Attachment is obsolete: true
Depends on: 730289
No longer depends on: 730289
need to schedule a full team review
Whiteboard: [secr:cutisk]
Blocks: 741393
Please follow the instructions on this page to schedule a review.
Whiteboard: [secr:cutisk] → [sec-assigned:cutisk:749625]
Attachment #599277 - Attachment is obsolete: true
Attachment #599278 - Attachment is obsolete: true
These updated patches (probably the second one) are non-functional - no "Capture" button appears.  They compile clean, though! :-)  They are for running on top of the about-to-be-pushed update to alder from webrtc.org
Summary: camera support for desktop → camera support for desktop <input accept=image/*> tag.
Flags: sec-review?(curtisk)
Whiteboard: [sec-assigned:cutisk:749625]
Flags: sec-review?(curtisk) → sec-review?

Mass-removing myself from cc; search for 12b9dfe4-ece3-40dc-8d23-60e179f64ac1 or any reasonable part thereof, to mass-delete these notifications (and sorry!)

Severity: normal → S3

The severity field for this bug is relatively low, S3. However, the bug has 18 votes and 50 CCs.
:fabrice, could you consider increasing the bug severity?

For more information, please visit auto_nag documentation.

Flags: needinfo?(fabrice)

The last needinfo from me was triggered in error by recent activity on the bug. I'm clearing the needinfo since this is a very old bug and I don't know if it's still relevant.

Flags: needinfo?(fabrice)

fabrice, do you have any objections to removing the "camera" alias from this bug for the sake of Bugzilla search-ability of camera related bugs?

Flags: needinfo?(fabrice)

(In reply to Nico Grunbaum [:ng, @chew:mozilla.org] from comment #38)

fabrice, do you have any objections to removing the "camera" alias from this bug for the sake of Bugzilla search-ability of camera related bugs?

No, feel free to make the changes you need. I'm not even sure that <input accept=image/*> is still something we want so maybe we should just close this bug WONTFIX.

Flags: needinfo?(fabrice)

I believe this is a very useful feature for firefox, special on smartphones.
It's quite common with native apps to include an option to just snap a photo when an image is wanted.
More and more as time goes it becomes more useful to have the option to just snap the photo directly into the web form.

Flags: needinfo?(fabrice)

(In reply to brunoais from comment #40)

I believe this is a very useful feature for firefox, special on smartphones.
It's quite common with native apps to include an option to just snap a photo when an image is wanted.
More and more as time goes it becomes more useful to have the option to just snap the photo directly into the web form.

I don't disagree, but I'm not the one making these decisions for Gecko/Firefox.

Flags: needinfo?(fabrice)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: