I am trying to implement something like the camera on/off toggle that Google Meet has. I have tried getting the tracks from getUserMedia and setting enabled = true/false, it works but the camera indicator light is still on all the time. How are they able to toggle the camera and the indicator light?
Asked
Active
Viewed 241 times
1
-
There is a bug in Chrome (which I assume the Meet team is aware of) and Safari. You can call `stop()` instead. https://stackoverflow.com/questions/64012898/how-to-completely-turn-off-camera-on-mediastream-javascript/64013564#64013564 – chrisguttandin Apr 27 '22 at 21:25
1 Answers
1
To lose the camera indicator you will have to remove any reference to the stream (no just set enabled to false). So you have to remove the track from the peer. Thanks to Transceiver APi you can easily switch/remove track from the peer without renegotiate the ice.

Pierre Noyelle
- 478
- 3
- 8