1

I have an html page, within it i have a button called open camera, it is a regular button. I was wondering how to i go to the native side of ios and make the camera open by a click from the html content?

2

1 Answer 1

4

Starting iOS 6 you can use this code:

<input type="file" accept="image/*" capture="camera">
<input type="file" accept="video/*" capture="camera">

It will act like a regular file upload, but instead, it will open the iPhone camera and upload a picture or a video as mentioned in this StackOverflow answer

4
  • so how do i call it from my native side to actually open the camera? Commented Feb 25, 2013 at 18:44
  • You add this code inside your html code, indeed you only need to change your html code for displaying the Open Camera button, change the type to file and add the accept and capture attributes.
    – Paul N
    Commented Feb 25, 2013 at 20:42
  • what is the specified code for the camera to respond and open? Commented Feb 26, 2013 at 19:20
  • Can I somehow remove the Choose Existing button? I want the video to be uploaded directly from camera only.
    – Adil Malik
    Commented Apr 17, 2014 at 14:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.