Hi,
I'm trying to stop local audio/video(not to disconnect from a room but just to stop the local audio/video).
I tried the following code and it does stop sending the audio/video, the problem is that the webcam light is still on, like it is still broadcasting the video.
var tracks = Array.from(room.localParticipant.tracks.values());
tracks.forEach(function(track) {
room.localParticipant.removeTrack(track);
});
Well, I was about to report the same problem. Even with the disconnect() and the removeTrack(track), I keep getting the light of the webcam and Chrome still shows the recording icon in the tab.
I'm working on MacOS 10.12.4 with Google Chrome 58.0.3029.41 beta (64-bit).
Thanks for the report @theDude30 & @adriantombu,
To be clear,
tracks property when calling connect).removeTrack after a LocalTrack is removed should not throw (currently getting a "TypeError: Cannot read property 'forEach' of undefined"). @manjeshbhargav's change in https://github.com/twilio/twilio-video.js/commit/e20d86e217b445fbc2c95cb511a0a8289ffa14ee should fix this.As a workaround for now, you can call
room.localParticipant.tracks.forEach(track => track.stop());
Most helpful comment
Thanks for the report @theDude30 & @adriantombu,
To be clear,
tracksproperty when callingconnect).removeTrackafter a LocalTrack is removed should not throw (currently getting a "TypeError: Cannot read property 'forEach' of undefined"). @manjeshbhargav's change in https://github.com/twilio/twilio-video.js/commit/e20d86e217b445fbc2c95cb511a0a8289ffa14ee should fix this.As a workaround for now, you can call