title: Browser keeps on accessing the camera with red dot even after stopping the stream aafter establishing the peer connection using webRTC
body: <pre><code>let localStream;
  let peerConnection;
  navigator.mediaDevices.getUserMedia({
     audio: true,
     video: true
  }).then(function(stream) {
     createPeerConnection();
     localStream = stream;
     peerConnection.addStream(localStream);
  });
  </code></pre>
  <p>so when stopping the stream it stops the video</p>
  <pre><code>localStream.getTracks().forEach(track =&gt; track.stop());
  </code></pre>
  <p>But the browser tab says that it is accessing the camera or microphone with a red dot besides it. I just do not want to reload the page in order to stop that.</p>
  <p>Note: this happens when after establishing a peer connection using webRTC and after disconnecting the peers the camera light stays on.</p>
  <p>Is there any way to do that. Thanks for your help in advance.</p>
  <p><a href="https://i.stack.imgur.com/KIXkG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KIXkG.png" alt="enter image description here" /></a></p>