Hi,
i am kind of struggeling in using the audiobridge in a differnet way than in the samples.
I do want join muted but i do not want to mute the stream serverside but not provide the microphone audio stream at all.
(I don´t want to disrupt the user in seeing his mic is on where he actually is not exposing and audio and i want to save bandwidth on server and client)
Thus i would like to join the audiobridge without using the microphone and then later add the microphone audio stream if required.
The only way to get proper SDP for this approach was to call the createOffer with the legacy options:
const offeroptions = {} as RTCOfferOptions;
offeroptions.offerToReceiveAudio = true;
const offer = await this.pc.createOffer(offeroptions);
i get proper SDP, send it to janus set the reply and the inbound audio is successfully established, thus i hear the others without exposing my microphone.
Where i kind of run against the wall is when i try to add the microphone stream to the existing handshaked peerconnection.
1.) I do wonder that peer connection has a sender!?
let existingSender: RTCRtpSender | undefined = undefined;
const senders = this.pc.getSenders();if (senders && senders.length === 1)
existingSender = senders[0];
it has a sender without a track.
if i try to set my audio track nothing happens.
await existingSender.replaceTrack(newTrack);
So i tried to initiate a manual renegotiation in sending sdp to janus with the configure command.
I get a reply and pass it into the PC with setRemoteDescription but nothing happens.
It does work however, if i initially had the audio stream while initilizing the PC and then switch off and again on the mic.
Having played around with it in ff and chrome...
Any hints in which direction i could dig?
Jan