Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome and Firefox are not able to access iPhone Camera

The below code of HTML

<video id="video" class="video" height="400" width="400" playsinline autoplay muted loop></video>

and JavaScript

var video = document.getElementById("video");

navigator.mediaDevices.getUserMedia({video: true, audio: false})
    .then(function(s) {
    stream = s;
    video.srcObject = s;
    video.play();
  })

The link works fine on all Browsers in Android device, also works fine on Safari browser of iPhone devices, but it does not even ask camera permission for other Browsers like Chrome and Firefox on iPhone Devices.

like image 601
Simon Fernandes Avatar asked Jul 24 '18 14:07

Simon Fernandes


People also ask

Why can't chrome access my Camera?

Check your browser permissions On Chrome or Microsoft Edge: Open the menu (the three dots ⋮) in the top, right-hand corner of your browser. Select Settings > Privacy & Security > Site Settings. Ensure that your Camera and Microphone both have Ask before accessing set to ON.

How do I allow my browser to access my Camera on my iPhone?

Step 1: Go to Settings > Privacy. Step 2: Tap on Camera to see which apps have access to it. You can allow or block apps using Camera from here.


1 Answers

I have not tested this myself, but apparently this functionality was introduced in November 2020


Original answer:

Chrome and FireFox on iOS still use the iOS WebKit rendering engine. getUserMedia is only available in Safari, not other browsers on iOS.

This is currently being tracked here: https://bugs.chromium.org/p/chromium/issues/detail?id=752458 - but given it was first reported over a year ago and just 5 days ago it was updated to say it hasn't been fixed, I am not holding my breath.

like image 137
Mark Henderson Avatar answered Oct 04 '22 20:10

Mark Henderson