From be0b22340484d47dc4d9722d42d88e90a4b39a9d Mon Sep 17 00:00:00 2001 From: ao-anam Date: Wed, 14 May 2025 11:56:10 +0100 Subject: [PATCH 1/2] 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( From da03ec07b7411238a13485d7aa4ead51a28b76d8 Mon Sep 17 00:00:00 2001 From: ao-anam Date: Wed, 14 May 2025 12:22:42 +0100 Subject: [PATCH 2/2] chore: remove debug logging --- src/modules/StreamingClient.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/modules/StreamingClient.ts b/src/modules/StreamingClient.ts index 436cefe..a8a17a3 100644 --- a/src/modules/StreamingClient.ts +++ b/src/modules/StreamingClient.ts @@ -243,9 +243,6 @@ export class StreamingClient { // add transceivers this.peerConnection.addTransceiver('video', { direction: 'recvonly' }); if (this.disableInputAudio) { - console.log( - 'StreamingClient - initPeerConnection: adding recvonly audio transceiver', - ); this.peerConnection.addTransceiver('audio', { direction: 'recvonly' }); } else { this.peerConnection.addTransceiver('audio', { direction: 'sendrecv' }); @@ -499,10 +496,6 @@ 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(