1

I created a video calling system. But when I disconnect the call the camera should off. I used MediaStreamTrack.stop() to stop all tracks but it's not working.

Code to stop the stream:-

  const tracks = stream.getTracks();
  tracks.forEach((track) => {
    track.stop();
  });
  stream.load();
  remoteStream.current.srcObject = null;
  localSteam.current.srcObject = null;

After stopping the stream still getting this.... enter image description here

kevin
  • 11
  • 3
  • you need to stop all tracks for *every* stream you acquired via getUserMedia. Most likely you have a dangling track somewhere. – Philipp Hancke Oct 25 '22 at 20:22

0 Answers0