Chrome 浏览器获取音频设备权限问题 Microphone and Camera access no longer works on insecure origins

1.Chrome 浏览器使用 navigator.mediaDevices.getUserMedia获取资源时报错

Cannot read property getUserMedia of undefined

 

2.Chrome 浏览器http无法调用音频设备

Microphone and Camera access 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.

 

 

解决Chrome浏览器安全权限问题

我们可以通过以下方式解决:

一、网页使用https方式访问

此操作需要依赖web服务提供者实现https的访问方式。

二、修改浏览器安全配置(最直接、简单)

1、浏览器地址栏输入:

chrome://flags/#unsafely-treat-insecure-origin-as-secure

 

2、开启Insecure origins treated as secure

在输入栏内输入你需要访问音频设备的地址url,然后将右侧Disabled 改成 Enabled,浏览器会提示重启(Relaunch)

 

posted @ 2020-12-29 09:56  Aaronguo  阅读(3378)  评论(0编辑  收藏  举报