webrtc / samples

WebRTC Web demos and samples
https://webrtc.github.io/samples
BSD 3-Clause "New" or "Revised" License
13.77k stars 5.69k forks source link

webrtc disable my voice for one of peers not all #1519

Closed hdev72 closed 2 years ago

hdev72 commented 2 years ago

hello dear friends im working on one to many connection in webrtc and now i want disable my audio and video for one of peers not all how is it possible? if i disable my audioTrack it will mute me for all peers but i want to disable my voice for some of peers not all if i send to peers to disable me they can hack and reject my request so i should do it in my side not other peers sides is there any way without disconnecting like pause peerconnection or ..? thank you so much

hdev72 commented 2 years ago

resolved with this: peerConnection.getReceivers().get(i).track().setEnabled(enable/disable); peerConnection.getSenders().get(i).track().setEnabled(enable/disable);