I have stopped the media stream when turn off camera. I want that when I turn on camera stream should resume.
Camera off:
this.stream1.getTracks().forEach((track) => track.stop());
I tried to resume the track/stream after turning on camera
const newStream= navigator.mediaDevices.getUserMedia({ video:true})
this.stream1.getTracks().forEach((track) => {
newStream.addTrack(track.clone());
});
this.stream1 = newStream;