node-webrtc-examples icon indicating copy to clipboard operation
node-webrtc-examples copied to clipboard

Unable to relay Audio back to browser

Open scootercop opened this issue 5 years ago • 0 comments
trafficstars

So i've done this on the server

const audioTransceiver = pc.addTransceiver("audio");
audioTransceiver.sender.replaceTrack(audioTransceiver.receiver.track);

while creating the pc(peerconnection) object

and on the client

const remoteStream = new MediaStream(
   pc.getReceivers().map((receiver) => receiver.track)
 );
 remoteAudio.srcObject = remoteStream;

right before

`pc.setRemoteDescription(new RTCSessionDescription(message));`

But my remote audio stream isn't really working. Like it's just stuck at 0:00 not playing. I checked and the pc.getReceivers() does return mediaStream with 1 track (audio, which is all that im using).

Probably some mistake in my code but if anyone could help out that's be great. Thanks.

scootercop avatar Nov 05 '20 20:11 scootercop