Using javascript to capture photo from iPhone / Android Camera
possible to use javascript (like PhoneGap, but not PhoneGap) to capture a photo? I realize that this post: http://www.google.com/url?sa=D&q=https://stackoverflow.com/qu开发者_如何学运维estions/2953865/javascript-camera-api-android-froyo states that it is coming - but what about iPhone?
This seems to be the proposal for client side camera/microphone access (Capture API):
http://www.w3.org/TR/2010/WD-media-capture-api-20100928/
Given that it's a draft w3c standard, it's certainly possible that iOS devices will support it, probably some time in the future. I wouldn't assume that it will be available any time soon.
This is now possible!
Method 1: Use WebRTC to get video feed, and capture images from there. Not widely supported, but works in chrome and webkit webview (Android 5+). Support tables
Method 2: Use HTML Media Capture. e.g. <input type="file" accept="image/*" capture>
Here's a very comprehensive article about media capture in mobile browsers.
Support tables at mobilehtml5.org say it's supported on Android 3.0+ and iOS 6+.
精彩评论