Chrome: navigator.mediaDevices.getUserMedia is not a function

前端 未结 7 1245
长发绾君心
长发绾君心 2021-01-04 00:53

I\'m on localhost and trying to use the MediaDevices.getUserMedia method in Chrome. I receive the error as titled. I understand that in Chrome it is only possible to use thi

7条回答
  •  温柔的废话
    2021-01-04 01:20

    I got stuck in the same issue. One solution is to follow and download the extension Web Server for Chrome shared in the comment above by @ellerynz, or

    if you have python installed you could also do

    python -m SimpleHTTPServer [port]
    

    After you hit enter, you should see the following message:

    Serving HTTP on 0.0.0.0 port 8000 ...
    

    Open the browser and put

    http://127.0.0.1:[port]
    

提交回复
热议问题