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?

Piyush Dubey
  • 2,416
  • 1
  • 24
  • 39
user2106262
  • 11
  • 1
  • 2

1 Answers1

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

Community
  • 1
  • 1
Paul N
  • 1,901
  • 1
  • 22
  • 32
  • so how do i call it from my native side to actually open the camera? – user2106262 Feb 25 '13 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 Feb 25 '13 at 20:42
  • what is the specified code for the camera to respond and open? – user2106262 Feb 26 '13 at 19:20
  • Can I somehow remove the `Choose Existing` button? I want the video to be uploaded directly from camera only. – Adil Malik Apr 17 '14 at 14:27