I create asp.net web application and copy code from https://webrtc.github.io/samples/src/content/getusermedia/canvas/ and public project to iis link http://123.111.1.222/test/camera.aspx not working is error
This is the error message
Uncaught TypeError: Cannot read properties of undefined (reading 'enumerateDevices'
code here
navigator.mediaDevices.enumerateDevices().then(gotDevices).catch(handleError);
You need to be on
https://orlocalhostfornavigator.mediaDevicesto be available.For security purposes, accessing
mediaDevicesonhttp://is not allowed. Therefore, you receive an error that it cannot find the fuctionenumerateDevices, because indeed,mediaDevicesis undefined.Solutions, from easy to hard:
localhostas your development server.https.https://.