I am quite new to HTML5
. I try the following HTML5
code to access camera on my mobile phone. It always display \"Native web camera not supporte
You can use Chrome for Android by enabling the "Enable WebRTC" flag under chrome://flags
I tested on my android phone to access camera on html5 page and it's working.
HTML5 added support for camera access, you can use it like this:
<input type="file" accept="image/*" capture>
<input type="file" accept="image/*" capture="user">
<input type="file" accept="image/*" capture="environment">
Where user
is for front camera and environment
is for back camera.
We've had some success with this basic approach cobbled together from across the Web:
<form method="post" action="takephoto.php" enctype="multipart/form-data">
<input type="file" accept="image/*" name="file">
<input type="submit">
</form>
Then in the PHP file we generate unique file names using now() or something similar for storage.
This works on Firefox mobile, Chrome mobile, iPhone and Android:
<input type="file" id="mypic" accept="image/*">
Opera Desktop, Opera mobile and Chrome (after changing some configuration) supports HTML5 camera / microphone access so far.
<input type="file" accept="image/*;capture=camera">
See Capturing Audio & Video in HTML5
Support:
- Android 3.0 browser - one of the first implementations. Check out this video to see it in action.
- Chrome for Android (0.16)
- Firefox Mobile 10.0
- iOS6 Safari and Chrome (partial support)