Trouble with navigator.mediaDevices.getUserMedia with chrome on iPhone X Trouble with navigator.mediaDevices.getUserMedia with chrome on iPhone X google-chrome google-chrome

Trouble with navigator.mediaDevices.getUserMedia with chrome on iPhone X


Having the same troubles on iOS 11.2x. My researches showed that FF and Chrome are supported on OS but NOT on iOS even they would be able to support media devices. You can test easy mediaDevice availability:

            if (navigator.mediaDevices) {            alert ("Media device supported");        }        else {            alert ("Media device not supported");        }

You can check that here too: HTML5Test

FF and Chrome on iOS will show "Media device not supported" while Safari says its supported. The reason looks like Apple has still not given free the access to other browsers using mediaDevices.You can imagine some reasons why that is. ;/ So don't blame Chrome or Firefox this time.

Would be interesting to know if it now works in iOS 12.


This works with FF and Chrome on desktop and phone. Note: width and height are reversed on desktop and phone. Note: FF and Chrome allow it to run on localhost and https. Chrome will NOT allow it to run on a http site.

function fnStreamVideo(){    navigator.mediaDevices.getUserMedia({ video:true })    .then(function(stream) {        let video = document.getElementById('video');        video.srcObject = stream;        video.onloadedmetadata = function(e) {            video.play();            video.width=480;            video.height=320;        };    })    .catch(function(e){});}