How to access iphone camera from webapp(server-side web)? (ex asp,php,jsp)
2 Answers
It's not possible for code running on a server to access an iPhone's camera. It's not even possible for client-side web-app code (Javascript, HTML, CSS) to access the camera.
You'll need to write a full native app to be able to work with the camera. If you'd still like to be able to use web-technologies to do this, have a look at PhoneGap: http://phonegap.com/
PhoneGap makes it easier to write an app that loads a web page, but allows for access to device native APIs. Building the user interface will be more difficult though.
it is possible to access camera in iOS
First, in HTML body use video tag as below
<video id="video" class="video" height="400" width="400" playsinline autoplay muted loop></video>
this will ask permission to access the camera
Then in JavaScript, by using video element, display the video on the video tag
var video = document.getElementById("video");
navigator.mediaDevices.getUserMedia({video: true, audio: false})
.then(function(s) {
stream = s;
video.srcObject = s;
video.play();
})