i working on webrtc. right using echo challenge, thinking microphone toggling techniques. example, user talking switch off microphone of user b , vice versa. webrtc has build in implemented? if not how can achieve ? appreciated.
webrtc doesn't have built in, because more related media presentation layer. strategy use, employed simplewebrtc via attachmediastream module simple attach local participant's media video (or audio, audio only) element muted.
the relevant code found in main file of module here. this:
if (!element) { element = document.createelement(opts.audio ? 'audio' : 'video'); } else if (element.tagname.tolowercase() === 'audio') { opts.audio = true; } // mute video element local participant's audio doesn't play - local participant, not remote participants if (opts.muted) element.muted = true; // attach stream element if (typeof element.srcobject !== 'undefined') { element.srcobject = stream; }