TypeError: Cannot read property ‘getUserMedia’ of undefined
localhost正常访问
IP地址被拒绝
getUserMedia的安全浏览情况是:
- https
- 文件:///
- 主机
所以直接访问ip地址会出现报错
使用Chrome参数开启可以解决这个问题,在浏览器框中输入下述代码
chrome://flags/#unsafely-treat-insecure-origin-as-secure
将你需要访问的IP填入后重启浏览器,就能解决报错
参考链接:https://blog.clarence.tw/2020/10/29/solve-the-undefined-problem-of-getusermedia/