RTCMultiConnection icon indicating copy to clipboard operation
RTCMultiConnection copied to clipboard

Listen to audio stream without microphone

Open mkipness opened this issue 2 years ago • 1 comments

Has anyone gotten this working successully? I've tried all kinds of suggestions but it seems like the computer without the mic cannot enter the stream, so can't hear anything.

Thanks, Max

mkipness avatar Dec 20 '22 18:12 mkipness

This should be useful for you, it's an example, I've tested it and it works.

connection.dontCaptureUserMedia = false;
connection.session = {
      data: true,
      video: false,
      screen: false,
      audio: true,
};

connection.mediaConstraints = {
      audio: true,
      video: false,
      screen: false,
}

/** Disabled camera and mic */
connection.mediaConstraints.video = false;
connection.mediaConstraints.audio = true;
connection.session.video = false;
connection.session.audio = true;
	            
connection.sdpConstraints.mandatory = {
      OfferToReceiveAudio: true,
      OfferToReceiveVideo: true
};

connection.sessionid = 'room-id';
/** Connected code now */

MediaKitApp avatar Feb 14 '23 13:02 MediaKitApp