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)

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM