Chrome and Firefox are not able to access iPhone Camera

五迷三道 提交于 2019-12-30 18:44:19

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/51501642/chrome-and-firefox-are-not-able-to-access-iphone-camera

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!