I've been using webkitGetUserMedia method (getUserMedia through adapter.js) to get the camera nad microhpone for webRTC on my web app. My server is not secure (no SSL certificate). It all worked fine until I started getting an error saying : "getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details."
I googled and I saw that now in Chrome I need to use navigator.mediaDevices.getUserMedia(). I'm using Chrome 47.0.2526.80 m, and on this page https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia it says that this method should be supported for this version. However when I call navigator.mediaDevices.getUserMedia I get undefined. So now I cannot use either method in Chrome.
Can anyone please help me with this issue. Thanks
When getUserMedia() is invoked, the browser asks for permission from the user to use the media inputs (camera or microphone or both) connected to the user device. Syntax : navigator. mediaDevices.
getUserMedia() Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes.
The MediaDevices . getUserMedia() method prompts the user for permission to use a media input which produces a MediaStream with tracks containing the requested types of media.
getUserMedia is not supported for safari.
As per new chrome update (From Google Chrome 47), getUserMedia() is no longer supported in chrome browser over http:// (Unsecure Origin) , It will work on https:// (Secure Origin)
For development purpose,
1.localhost is treated as a secure origin over HTTP, so if you're able to run your server from localhost, you should be able to test the feature on that server.
2.You can run chrome with the --unsafely-treat-insecure-origin-as-secure="http://example.com"
flag (replacing "example.com" with the origin you actually want to test), which will treat that origin as secure for this session. Note that you also need to include the --user-data-dir=/test/only/profile/dir
to create a fresh testing profile for the flag to work.
reference: https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With