Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing camera in phone for iOS and Android using HTML5

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?

like image 559
LariJL Avatar asked Sep 02 '14 17:09

LariJL


People also ask

Can HTML5 run on Android and iOS?

Some cross-compilers can allow the creation of application targeting both Android and iOS, but only HTML5 can run in mobile operating systems and on the Internet in browser.

Does HTML5 work on mobile?

As HTML5 is an accepted Web standard, it can create apps that are compatible not only with mobile devices but also desktop and notebook browsers, for a seamless experience across all a user's devices.

Can iOS run HTML5?

iOS, Android, Windows, Mac, Linux, etc, all have HTML5 capabilities.


1 Answers

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.

like image 74
Zomby Avatar answered Sep 30 '22 17:09

Zomby