We are implementing sharing screen with audio using Screen Capture API(getDisplayMedia) by using JavaScript. To get the requested screen we passed the below constraints in getDisplayMedia(constraints),
constraints = {audio: {echoCancellation:true,echoCancellationType:'browser',autoGainControl:true,noiseSuppression:true}, video: true};
then we shared promised stream via webRTC,
Let’s consider A and B users are there,
A is sharing the screen and screen got shared to B via webRTC
then user B is getting ECHO issue(while talking to user A),
Note: if user A share specific tab/window screen then ECHO is not there at user B(while talking to user A)
We are using getDisplayMedia(constraints) like below,
if (navigator.mediaDevices.getDisplayMedia) {
navigator.mediaDevices.getDisplayMedia(constraints).then(function (stream) { /*adding stream to webRTC and sharing to user B*/ }, function (error) { /*handling errors*/ });
} else {
navigator.getDisplayMedia(constraints).then(function (stream) { /*adding stream to webRTC and sharing to user B*/ },function (error) { /*handling errors*/ });
}
Any help would be appreciated. Thanks.