Приложение веб-камеры:не удалось разрешить перегрузку

#javascript #overload-resolution

Вопрос:

У меня есть этот код для приложения веб-камеры, в котором есть ошибка :не удалось разрешить перегрузку.

 const video=document.getElementById('webcam'); const canvas=document.getElementById('photo'); const ctx=canvas.getContext('2d'); function getVideo() {  navigator.mediaDevices.getUserMedia({audio:false, video:true}).then(localMediaStream=gt;{ video.srcObject=window.URL.createObjectURL(localMediaStream); video.play(); });}  function paint() {  const width=video.videoWidth;  const height= video.videoHeight;  canvas.width=width;  canvas.height=height;  setInterval(function (){ctx.drawImage(video,0,0,width,height)},16);   }   video.addEventListener('canplay',paint());  getVideo();