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?
Asked
Active
Viewed 4,835 times
1
-
Take a look at this: http://phonegap.com/about/feature/ – Babblo Feb 25 '13 at 18:31
-
i am trying to avoid phonegap and third parties – user2106262 Feb 25 '13 at 18:42
1 Answers
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
-
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
-
-
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