Google 浏览器 WebRTC 的 getUserMeida 在本地工作正常,但上传到服务期访问,发现 Video 标签没有视频输入,F12 查看前端报错:
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.
最新版的 Chrome 浏览器需要 https 访问才能调用 getUserMedia。
解决办法是购买https证书,或者自制证书让服务器支持 https 访问。
免费申请的网站:
https://startssl.com/
https://letsencrypt.org