How to use getUserMedia in Chrome for iOS

Rao picture Rao · Mar 20, 2015 · Viewed 29.3k times · Source

I am developing a simple application, in this I am trying to access camera and microphone using getUserMedia. Its working fine for me in desktop Chrome and Android Chrome but it's not working in iPhone and iPad Chrome.

navigator.getUserMedia = navigator.getUserMedia
        || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
var constraints = "";
if (mediaType === "audio,video") {
    constraints = {
        audio : true,
        video : true
    };
} else {
    constraints = {
        audio : true,
        video : false
    };
}
navigator.getUserMedia(constraints, successCallback, errorCallback);

Answer

wpp picture wpp · Mar 20, 2015

... but it's not working in iPhone and iPad Chrome.

The chrome app on your iPhone or iPad is not running "a full" version of chrome. It's capabilities are limited to the iOS platform. So getUserMedia and the like probably won't be available until Safari/Apple supports it.

Quoting from another question:

Apple policy forces other browser to use their version of webkit which does not support webRTC, so you will not have webRTC support in a web app on iOS anytime soon. Activity in webkit hints as a change, but time for this to land, it will be months.