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
Created attachment 565664 [details] [diff] [review]
part 1: backend
We create an async input stream that receives frames from gips.
Created attachment 565666 [details] [diff] [review]
part 2: front-end
Showing the capture picker in a tab-modal dialog.
Created attachment 565669 [details]
screenshot: capture picker
Created attachment 565670 [details]
screenshot: capture done!
These patches apply on top of the Alder project repository:
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.
The feature page is here: https://wiki.mozilla.org/Platform/Features/Camera_API
*** Bug 451674 has been marked as a duplicate of this bug. ***
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.
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.
> 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.
> when the user presses the <Enter>
That's subject to attacks (e.g. the "press enter game")
Created attachment 570795 [details] [diff] [review]
part 1 : gips backend
updated gips backend
Created attachment 570797 [details] [diff] [review]
part 2: capture picker UI
Fixes an osx only bug
Created attachment 570798 [details] [diff] [review]
part 3: xcode 4.2 support
removing sec-review-needed and marking the feature page instead
Mockups from Jennifer:
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:
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.
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.
Created attachment 585530 [details] [diff] [review]
gips backend updated for bitrot
Created attachment 585531 [details] [diff] [review]
capture UI updated for bitrot
Added URL for fabrice's test (perhaps you should put the code here)
Created attachment 586224 [details] [diff] [review]
gips backend updated for EXPORTS change
Created attachment 590312 [details] [diff] [review]
capture picker UI - updated for gkmedia m-c merge
I pushed a couple of changes to alder:
With those changes, I was able to build with these patches applied and get working video capture on Windows.
Created attachment 599277 [details] [diff] [review]
Part 1: GIPS backend, updated for m-c merge
Created attachment 599278 [details] [diff] [review]
Part 2: capture picker UI, updated for m-c merge
need to schedule a full team review
Please follow the instructions on this page to schedule a review.
Created attachment 619047 [details] [diff] [review]
Part 1: GIPS backend, updated for webrtc merge - non-functional
Created attachment 619048 [details] [diff] [review]
Part 2: capture picker UI, updated for webrtc merge - non-functional
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