Bestfoodnearme.com
Bestfoodnearme.com

Reputation: 291

Javascript API for IOS Iphone 3G for camera access

Is there a way to access the iPhone 3G camera via JavaScript to capture a photo and then utilize this photo in an HTML POST? I came across an API called PhoneGap but from a search on here it only mentioned for the IPhone 4. I was hoping to find something that would work on the 3G and 3GS models.

Upvotes: 3

Views: 7111

Answers (6)

06Sergio
06Sergio

Reputation: 11

Now, with IO6 you can use the input file type :

<input type=”file”>

directly in your form.

Upvotes: 1

Fenton
Fenton

Reputation: 250922

Although this is an old question, I wanted to add that this feature is coming to The Web and is already implemented in some browsers.

navigator.getMedia = (
    navigator.getUserMedia ||
    navigator.webkitGetUserMedia ||
    navigator.mozGetUserMedia ||
    navigator.msGetUserMedia);

There is a W3C Specification for getUserMedia.

Although this actually gets you video, you can then take a still image from that video stream.

There are lots of APIs coming to the browser - so good times ahead!

Upvotes: 1

ceejayoz
ceejayoz

Reputation: 180014

I came across an API called PhoneGap but from a search on here it only mentioned for the IPhone 4. I was hoping to find something that would work on the 3G and 3GS models.

PhoneGap does indeed work on 3G and 3GS.

Upvotes: 1

Sindre Sorhus
Sindre Sorhus

Reputation: 63487

Phonegap is an easy solution, and it support camera access for all iPhones.

Supported features: http://www.phonegap.com/features

Upvotes: 3

abbott
abbott

Reputation: 11

Yes, we wrote one last year. Try our git repo for iOS Web Camera — https://github.com/egghaus/iOSWebCamera

It posts through a sinatra app.

Upvotes: 1

Max
Max

Reputation: 16719

No, there is no way to access camera via JavaScript. You should use the UIWebView delegate to handle user interaction and then call the UIImagePickerController in it's callbacks

Upvotes: 0

Related Questions