From 77f47b2a0e9b1513601406780f7145facb0cb03a Mon Sep 17 00:00:00 2001 From: lukasIO Date: Fri, 3 Nov 2023 17:24:42 +0200 Subject: [PATCH 1/2] Correctly apply elementVolume on attach for webaudioMix --- src/room/track/RemoteAudioTrack.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/room/track/RemoteAudioTrack.ts b/src/room/track/RemoteAudioTrack.ts index 2b011eca28..9bb5ab1a71 100644 --- a/src/room/track/RemoteAudioTrack.ts +++ b/src/room/track/RemoteAudioTrack.ts @@ -101,9 +101,7 @@ export default class RemoteAudioTrack extends RemoteTrack { } else { super.attach(element); } - if (this.elementVolume) { - element.volume = this.elementVolume; - } + if (this.sinkId && supportsSetSinkId(element)) { /* @ts-ignore */ element.setSinkId(this.sinkId); @@ -114,6 +112,12 @@ export default class RemoteAudioTrack extends RemoteTrack { element.volume = 0; element.muted = true; } + + if (this.elementVolume) { + // make sure volume setting is being applied to the newly attached element + this.setVolume(this.elementVolume); + } + return element; } From 7e11efc11c2bc1abc13a213d29d0a337dcba4d05 Mon Sep 17 00:00:00 2001 From: lukasIO Date: Fri, 3 Nov 2023 17:26:36 +0200 Subject: [PATCH 2/2] Create dirty-parrots-kneel.md --- .changeset/dirty-parrots-kneel.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/dirty-parrots-kneel.md diff --git a/.changeset/dirty-parrots-kneel.md b/.changeset/dirty-parrots-kneel.md new file mode 100644 index 0000000000..c640320524 --- /dev/null +++ b/.changeset/dirty-parrots-kneel.md @@ -0,0 +1,5 @@ +--- +"livekit-client": patch +--- + +Correctly apply elementVolume on attach for webaudioMix