From be0b22340484d47dc4d9722d42d88e90a4b39a9d Mon Sep 17 00:00:00 2001 From: ao-anam Date: Wed, 14 May 2025 11:56:10 +0100 Subject: [PATCH] feat: change audio transceiver if disabling audio --- src/modules/StreamingClient.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/modules/StreamingClient.ts b/src/modules/StreamingClient.ts index 75a70c2..436cefe 100644 --- a/src/modules/StreamingClient.ts +++ b/src/modules/StreamingClient.ts @@ -242,7 +242,14 @@ export class StreamingClient { // add transceivers this.peerConnection.addTransceiver('video', { direction: 'recvonly' }); - this.peerConnection.addTransceiver('audio', { direction: 'sendrecv' }); + if (this.disableInputAudio) { + console.log( + 'StreamingClient - initPeerConnection: adding recvonly audio transceiver', + ); + this.peerConnection.addTransceiver('audio', { direction: 'recvonly' }); + } else { + this.peerConnection.addTransceiver('audio', { direction: 'sendrecv' }); + } } private async onSignalMessage(signalMessage: SignalMessage) { @@ -492,6 +499,10 @@ export class StreamingClient { try { const offer: RTCSessionDescriptionInit = await this.peerConnection.createOffer(); + console.log( + 'StreamingClient - initPeerConnectionAndSendOffer: offer', + offer, + ); await this.peerConnection.setLocalDescription(offer); } catch (error) { console.error(