2

Hello I need to access mobile camera using html by a button click, by searching for it on google and stackoverflow I have got some html input tag examples like below. But here what I need is, I have a custom button, when I click on the button I should be able to access my camera but below is a input tag and Im not able to add it to my button. So someone please help me how to do that.

Thanks a lot.

<input type="file" capture="camera" accept="image/*" id="cameraInput" name="cameraInput">  
Yavvari Pradeep
  • 301
  • 5
  • 19
  • Possible duplicate of [html5 display as image rather than "choose file" button](http://stackoverflow.com/questions/23916566/html5-input-type-file-accept-image-capture-camera-display-as-image-rat) – mplungjan Jan 10 '16 at 11:52

1 Answers1

4

If you want access to the native camera of an mobile device you can use the cordova camera plugin:

cordova camera API

You can open the camera by calling the getPicture() function.

camera.getPicture(successCallback, errorCallback, options)

Martin Godzina
  • 1,470
  • 11
  • 17