We've successfully implemented WebRTC is our system for Audio Call and Video Call including the CoTurn STUN/TURN server etc.
All is working fine until we decided to implement a Mute Mic and Mute Webcam function (for Local Stream only) where we can still see or hear other party but they cant see or hear us.
When Muting the Mic (Local Stream) it works as it should with no problems but when we UnMute the Mic there seems to be a severe Loopback (we hear our own voice) from our Local Stream.
This behavior is ONLY IN CHROME we're using the latest Version 83.0.4103.97 (Official Build) (64-bit). We tried in the latest Firefox but this behavior is not there.
No matter what we tried we cant seem to eliminate this severe Loopback issue. I hope some friends here can help us please.
Here is our code that we currently use ;
var isMute = false;
$(document).on('click','#audio_mute_div',function(){
var localStream = connection.attachStreams[0];
console.log(localStream);
if(isMute==false){
isMute = true;;
localStream.mute('audio');
$('.audio_mute').attr('src','./assets/mute.png');
}else{
isMute = false;
localStream.unmute('audio');
$('.audio_mute').attr('src','./assets/audio.png');
}
});
var isVideoMute = false;
$(document).on('click','#video_mute_div',function(){
var localStream = connection.attachStreams[0];
if(isVideoMute==false){
isVideoMute = true;
localStream.mute('video');
$('.video_mute').attr('src','./assets/no-video.png');
}else{
isVideoMute = false;
localStream.unmute('video');
$('.video_mute').attr('src','./assets/video-camera.png');
}
});--
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/cda55555-5690-49d0-8f84-9ad4034fb290o%40googlegroups.com.
I managed to solve this problem by simply adding this line ;
connection.streamEvents.selectFirst('local').mediaElement.muted=true;
in the UnMute Function, so now the function looks like this ;
isMute = false;
localStream.unmute('audio');
connection.streamEvents.selectFirst('local').mediaElement.muted=true;
$('.audio_mute').attr('src','./assets/audio.png');It solved the Loopback issue and it took me 5 days to look for this solution and finally found it here - https://www.rtcmulticonnection.org/docs/unmute/
--
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/ed7d5054-6123-4e42-b426-c43b8087f1ffo%40googlegroups.com.