Skip to content

Commit ee0e523

Browse files
authored
Merge pull request #89 from anam-org/feat/disable-input-audio
feat: change audio transceiver if disabling audio
2 parents 87a7b8a + be0b223 commit ee0e523

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/modules/StreamingClient.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,14 @@ export class StreamingClient {
242242

243243
// add transceivers
244244
this.peerConnection.addTransceiver('video', { direction: 'recvonly' });
245-
this.peerConnection.addTransceiver('audio', { direction: 'sendrecv' });
245+
if (this.disableInputAudio) {
246+
console.log(
247+
'StreamingClient - initPeerConnection: adding recvonly audio transceiver',
248+
);
249+
this.peerConnection.addTransceiver('audio', { direction: 'recvonly' });
250+
} else {
251+
this.peerConnection.addTransceiver('audio', { direction: 'sendrecv' });
252+
}
246253
}
247254

248255
private async onSignalMessage(signalMessage: SignalMessage) {
@@ -492,6 +499,10 @@ export class StreamingClient {
492499
try {
493500
const offer: RTCSessionDescriptionInit =
494501
await this.peerConnection.createOffer();
502+
console.log(
503+
'StreamingClient - initPeerConnectionAndSendOffer: offer',
504+
offer,
505+
);
495506
await this.peerConnection.setLocalDescription(offer);
496507
} catch (error) {
497508
console.error(

0 commit comments

Comments
 (0)