mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 21:15:32 +09:00
fix(voice): keep a remote track pinned at zero volume across re-attach (#1780)
This commit is contained in:
1 parent
528777926c
commit
5331c0216a
2 files changed
+12
-3
No files matched your search
@@ -52,6 +52,15 @@ source edits in this package.
|
|||||||
Forces Opus RED/FEC, stereo signaling, 10 ms packet time, no DTX, and a
|
Forces Opus RED/FEC, stereo signaling, 10 ms packet time, no DTX, and a
|
||||||
510 kbps maximum average bitrate in local offers and remote answers.
|
510 kbps maximum average bitrate in local offers and remote answers.
|
||||||
|
|
||||||
|
10. **Remote audio volume restore at exactly zero** (`src/room/track/RemoteAudioTrack.ts`)
|
||||||
|
`attach()`, `connectWebAudio()` and `getVolume()` guarded the remembered
|
||||||
|
`elementVolume` with a truthiness check, so a track deliberately held at `0`
|
||||||
|
came back at full volume whenever it was re-attached or its Web Audio graph
|
||||||
|
was rebuilt. All three guards now test `!== undefined`. Note that remote
|
||||||
|
gains above `1.0` are only legal because `setVolume()` takes the Web Audio
|
||||||
|
`gainNode` branch; the `el.volume` branch would throw `IndexSizeError`.
|
||||||
|
`webAudioMix` must stay unconditional.
|
||||||
|
|
||||||
## Updating from upstream
|
## Updating from upstream
|
||||||
|
|
||||||
1. Check the upstream changelog for the target version.
|
1. Check the upstream changelog for the target version.
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ export default class RemoteAudioTrack extends RemoteTrack<Track.Kind.Audio> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getVolume(): number {
|
getVolume(): number {
|
||||||
if (this.elementVolume) {
|
if (this.elementVolume !== undefined) {
|
||||||
return this.elementVolume;
|
return this.elementVolume;
|
||||||
}
|
}
|
||||||
if (isReactNative()) {
|
if (isReactNative()) {
|
||||||
@@ -113,7 +113,7 @@ export default class RemoteAudioTrack extends RemoteTrack<Track.Kind.Audio> {
|
|||||||
element.muted = true;
|
element.muted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.elementVolume) {
|
if (this.elementVolume !== undefined) {
|
||||||
this.setVolume(this.elementVolume);
|
this.setVolume(this.elementVolume);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ export default class RemoteAudioTrack extends RemoteTrack<Track.Kind.Audio> {
|
|||||||
lastNode.connect(this.gainNode);
|
lastNode.connect(this.gainNode);
|
||||||
this.gainNode.connect(context.destination);
|
this.gainNode.connect(context.destination);
|
||||||
|
|
||||||
if (this.elementVolume) {
|
if (this.elementVolume !== undefined) {
|
||||||
this.gainNode.gain.setTargetAtTime(this.elementVolume, 0, 0.1);
|
this.gainNode.gain.setTargetAtTime(this.elementVolume, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user