Accessing camera in phone for iOS and Android using HTML5
As you can see on "Can I use" the getUserMedia isn't yet available on most mobile browsers. The latest Chrome for Android should support it though.
Using <input type="file" accept="image/*;capture=camera">
seems to work on most modern mobile browsers.
LariJL
Updated on June 24, 2022Comments
-
LariJL almost 2 years
I need to create a photobooth mobile application and decided to use HTML5 to work on my mobile application. Currently, I am using the getUserMedia method which works perfectly well on my laptop webcam. However when I tried to test it out on my phone as an mobile application, it could not work and all it shows is a video icon. Which leads me to find out that getUserMedia does not support in Android Browser.
I would still like to continue using HTML5 to get my photobooth mobile application working but how can I access the camera in my phone and is it possible to do it?
-
LariJL over 9 yearsYes, it was through "Can I Use" that I realize getUserMedia is not available on most mobile browser. Is there a way to access the native camera on iPhone or Android phone or any method to to build a camera mobile application through HTML5?
-
Zomby over 9 yearsUsing <input type="file" accept="image/*;capture=camera"> seems to work on most modern mobile browsers. I didn't do extensive testing though so your mileage may vary.