Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to relay Audio back to browser #38

Open
scootercop opened this issue Nov 5, 2020 · 0 comments
Open

Unable to relay Audio back to browser #38

scootercop opened this issue Nov 5, 2020 · 0 comments

Comments

@scootercop
Copy link

scootercop commented Nov 5, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant