How to open phone camera from HTML page?

Viewed 30068

my android phone is connected to a web server through a webview. in my HTML I have a button to upload a photo. the user should have the choice to upload an image or take a photo from camera. my HTML code is:

 <div  class="takePhoto">
    <form id="take" action="" method="POST"> 
        <input type="file" id= "cap" name="personalPhoto" accept="image/*" capture ="camera" id="camera"><p>
    </form>
</div>

However when I click on the button the file chooser opens and I have the ability to choose images but not to use the camera. Any solution for this?

P.S. in my code the word (capture) doesn't have a special style or color which I find weird and this might be the problem!

5 Answers

i have tested this method and it worked for mobile devices

<input type="file" capture="user" accept="image/"/>

I have this kind of problem, nowadays. And I think that I find out the solution. But you have to do something more with my solution. You can check this. https://simpl.info/imagecapture/ After checking this, please share with me your experience. Thanks

Related