title: JS VIDEO | DOMException: Could not start video source
body: <p>I want to get a video from the webcam using JS but no footage.</p>
  
  <p><strong><em>MESSAGE:</em></strong></p>
  
  <blockquote>
    <p>DOMException: Could not start video source</p>
  </blockquote>
  
  <p><strong><em>App.js</em></strong></p>
  
  <pre><code>const video = document.getElementById("video");
  
  function startVideo() {
    navigator.getUserMedia(
      {
        video: {}
      },
      stream =&gt; (video.srcObject = stream),
      err =&gt; console.log(err)
    );
  }
  
  startVideo();
  </code></pre>
  
  <p><strong><em>index.html</em></strong></p>
  
  <pre><code>...
  &lt;body&gt;
      &lt;video id="video" width="720" height="540" autoplay muted&gt;&lt;/video&gt;
  &lt;/body&gt;
  ...
  </code></pre>
  
  <p>thanks for your help</p>