node-webrtc-examples
node-webrtc-examples copied to clipboard
Unable to relay Audio back to browser
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.