Search code examples
javascriptgoogle-chromewebrtcgetusermedia

navigator.mediaDevices.getUserMedia not working while navigator.getUserMedia() works


I know there are several posts on this, but my question is different.

Following the Mozilla developer guide for getUserMedia, I can see that using: navigator.getUserMedia() is deprecated:

New code should use Navigator.mediaDevices.getUserMedia() instead.

However, using Chrome (current version 57), navigator.getUserMedia() works great, while using navigator.mediaDevices.getUserMedia() throws an error:

navigator.mediaDevices.getUserMedia(...) is not a function

I am using HTTPS with Chrome.

Is it really deprecated? Am I missing something?


Solution

  • Chrome does support navigator.mediaDevices.getUserMedia API since version 53.

    From the discussion we had in comments, we were able to determine that this was caused by a browser plugin you have installed on your chrome, namely Cisco Webex.

    This video-conference plugin might modify the default navigator.mediaDevices object.
    which is wrong ! You should probably write to them about this issue.

    By disabling this plugin you'll be able to retrieve the original and well supported method in your chrome browser.