Last Updated: December 06, 2016
· climboid

Using the camera of your phone/tablet without phonegap

Sometimes you just want to get a hold of the camera and the picture it takes with out having to include anything. This is a way you can do that. So far it works for iPhone, iPad (with ios6). Haven't tested in android yet but it should work as well.

You are basically invoking the usage of the camera via html5 input type file accept camera, then you read the data of the imae and add it as base64 to an image tag and you are set!

You can add styles to the input type file to hide it and maybe use a camera icon (just maintain its visibility hidden not display:none)


3 Responses
Add your response

Works in Android too, at least on 4.1 running Chrome

over 1 year ago ·
over 1 year ago ·

I have recently done something very similar but included client side image resizing in browser.

Used as a basis for the work and wrote a jquery control to prettify the image upload button.

over 1 year ago ·

Have a fresh tip? Share with Coderwall community!

Post a tip