You will generally experience the screeching noise, if your self video is not muted. Therefore, when you receive the MediaStream object in payload stream when Events like "mediaAccessSuccess" or "incomingStream" gets triggered, you will have to mute self video.


In the case of "mediaAccessSuccess", the stream is related to self, hence simply set the <video> .muted property to true.

  

skylink.on("mediaAccessSuccess", function (stream) {
  var video = document.getElementById("myVideo");
  video.muted = true;

  attachMediaStream(video, stream);
});

  

In the case of "incomingStream", you will require to check if the stream is related to self by checking the isSelf payload flag, hence simply set the <video> .muted property to true if isSelf is true.


skylink.on("incomingStream", function (peerId, stream, isSelf, peerInfo) {
   var video = document.createElement('video');
   video.id = 'video_' + peerId;

   if (isSelf) {
     video.muted = true;
   }

   attachMediaStream(video, stream);
});

  


NOTE : 

There are also other reasons due to which you might experience a screeching noise.

1. Both your local test machines are in close proximity to each other and therefore result in feedback/echo

2. Your microphone's quality might not be suitable for clear audio transmission.