- From: Robin Berjon <robin@berjon.com>
- Date: Tue, 20 Sep 2011 10:53:22 +0200
- To: "Jimenez, Ernesto, VF-Group" <ernesto.jimenez@vodafone.com>
- Cc: <public-device-apis@w3.org>
Hi Ernesto, thanks for picking this one up! On Aug 17, 2011, at 13:04 , Jimenez, Ernesto, VF-Group wrote: > ISSUE-116: HTML Media Capture doesn't make sense if accept=image and > capture=microphone > ISSUE-117: Should HTML Media Capture have options for front/user camera > as in getUserMedia > (snip a very good, detailed use case) > > Initial proposal (to be discussed, polished and edited): > > The capture attribute may be added to the input element to provide user > agents with a hint of that by the default a file picker should be in > media capturing mode. > > When the capture attribute is present, user agents: > - MUST ignore the attribute if the accept attribute is not present > - MUST ignore the attribute if the accept attribute is not image/*, > video/* or audio/* I understand why you thought of these requirements but since it's a hint I'm not sure that we need these. If a UA has an idea of what to do for accept=message/rfc822 and capture=environment, why not? But I don't have a very strong opinion on this. > The UA should use the capture attribute following these steps: > 1. Let _accept_ be the value of the accept attribute > 2. Let _tokens_ be the ordered set of tokens in the capture attribute > 3. Let _position_ point to the first token in the set > 4. Let _token_ be the token in _tokens_ with position _position_ > 5. If _accept_ is "image/*", _token_ is "user" and the UA implements a > camera UI using a user-facing camera: show that browser UI and stop the > algorithm > 6. If _accept_ is "image/*", _token_ is "environment" and the UA > implements a camera UI using a camera facing the environment: show that > browser UI and stop the algorithm > 7. If _accept_ is "video/*", _token_ is "user" and the UA implements a > camcorder UI using a user-facing camera: show that browser UI and stop > the algorithm > 8. If _accept_ is "video/*", _token_ is "environment" and the UA > implements a camcorder UI using a camera facing the environment: show > that browser UI and stop the algorithm > 9. If _accept_ is "audio/*", _token_ is "user" and the UA implements > an audio recording UI using a microphone for the user: show that browser > UI and stop the algorithm > 10. If _accept_ is "audio/*", _token_ is "environment" and the UA > implements an audio recording UI using a microphone for the environment: > show that browser UI and stop the algorithm > 11. If _token_ is "filesystem" and the UA implements a file picker UI: > show that browser UI and stop the algorithm > 12. If _position_ is not pointing to the last token, increment > position and go to step 4 > 13. Otherwise, show the user agent's default UI for input type="file" This is all very good stuff, it should go into a draft! > I think this solution addresses the requirements I described. One small > concern I have is that the name of the capture attribute sounds to me > quite imperative. '<input type="file" accept="image/*" capture="user">' > sounds to me like the capture is a requirement, not a hint. We could call it |source|. I thought of |from| as well, but a very simple typo making it |form| could have drastic side effects! As usual, bikeshed naming is the editor's prerogative. Now if only we had an active editor... ;) -- Robin Berjon - http://berjon.com/ - @robinberjon
Received on Tuesday, 20 September 2011 08:53:49 UTC