2 ms·
For this to initiate, does it require user interaction? Is it possible to trigger this through javascript? Does it use the rear-facing and/or front-facing camer
by talmand 14y ago
For this to initiate, does it require user interaction? Is it possible to trigger this through javascript? Does it use the rear-facing and/or front-facing cameras? If an image is captured, does the phone let the user know? Can the user turn this feature off?
I see from the spec it mentions the part about user interaction, so at least that's there. I'm just curious how the other things work if anyone can get it to work on a device. Plus, if a page has a regular form for something unrelated, can this attribute be hidden in the form to snap an image to be uploaded as well without the user knowing it?
The spec also mentions metadata in the image. Will there be a way for the user to prevent that?
Also, the spec notes three attributes: camera, camcorder, microphone. They better lock this badboy down hard.
http://www.w3.org/TR/html-media-capture/ http://www.w3.org/TR/html-media-capture/
- dean 14y agoI just tried this. I went to http://fiddle.jshell.net/wut6z/show/ http://fiddle.jshell.net/wut6z/show/ (which is the HTML frame of a fiddle someone posted down this page), with my iPhone. It's just an HTML input tag with type=file and an "accept" attribute set to "image/*", and it shows up as a "Choose File" button in the browser. When you tap it, a sheet slides up from the bottom of the screen with buttons for "Take Photo", "Choose Existing" and "Cancel". Tapping "Take Photo", opens the rear-facing camera, and I have to tap to take the picture. "Choose Existing" opens the photo album. It works like a normal file chooser if your hardware doesn't support a camera. So, on this page, I had control over taking the picture. But you raise good points, and I'm curious what you could do with JavaScript if you were trying to take pictures without the user's knowledge. I'm also curious what metadata I just uploaded.