I am developing a video chat web application using react.js and kurento utils SDK for the media server. The problem is that the camera/light is still ON even after the video call is ended.The camera stops only for the first time and the problem occurs only from the second call.
let stream = videoElem.srcObject;
let tracks = stream.getTracks();
tracks.forEach(function(track) {
track.stop();
});
videoElem.srcObject = null;
}
I tried every possible ways to solve this issue and the above code is what i used for stopping camera.Is this a problem with react.js?
Can you try stopping individual video and audio track as webrtc APIs e.g.
mediaStream.getAudioTracks()[0].stop();
mediaStream.getVideoTracks()[0].stop();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With