Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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/questions/2953865/javascript-camera-api-android-froyo states that it is coming - but what about iPhone?

like image 545
Joey Schluchter Avatar asked Feb 02 '11 16:02

Joey Schluchter


People also ask

Does image capture work with Android?

Image Capture on your Mac The native app macOS app that works with a lot of third-party devices is Image Capture. Not only can you use it for your iPhone or DSLR camera, but you can also use a scanner with the app. That also means you can use it to import pictures from your Android too.

How do I capture an image in HTML?

The capture attribute is supported on the file input type. The capture attribute takes as its value a string that specifies which camera to use for capture of image or video data, if the accept attribute indicates that the input should be of one of those types. The user-facing camera and/or microphone should be used.

Can a webcam take pictures?

If your PC has a built-in camera or a connected webcam, you can use the Camera app to take photos and videos. To find the Camera app, select Start > Camera.


2 Answers

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.

like image 98
andrewmu Avatar answered Oct 24 '22 03:10

andrewmu


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+.

like image 33
posit labs Avatar answered Oct 24 '22 03:10

posit labs