mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 03:52:50 +08:00
fix: do not drop WebRTC volume updates
This commit is contained in:
1 parent
c38239ec35
commit
cd49409800
2 files changed
+3
-3
No files matched your search
@@ -925,7 +925,7 @@ async function handleCommand(
|
||||
entry.webrtc?.setAccompanimentActive(command.payload.active as boolean);
|
||||
} else if (command.type === "setMemberVolume") {
|
||||
const clientId = command.payload.clientId as number;
|
||||
if (entry.members.has(clientId)) entry.webrtc?.setMemberVolume(clientId, command.payload.volume as number);
|
||||
entry.webrtc?.setMemberVolume(clientId, command.payload.volume as number);
|
||||
}
|
||||
if (command.requestId) sendJson({ type: "commandCompleted", requestId: command.requestId });
|
||||
} catch (error: unknown) {
|
||||
|
||||
@@ -1475,14 +1475,14 @@ export function useVoiceWebSocket() {
|
||||
}
|
||||
const gain = remoteGains.get(clientId);
|
||||
if (gain) gain.gain.value = normalized * outputVolume.value;
|
||||
if (webrtcActive.value) sendCmd("setMemberVolume", { clientId, volume: normalized });
|
||||
if (webrtcPeer || webrtcActive.value) sendCmd("setMemberVolume", { clientId, volume: normalized });
|
||||
}
|
||||
|
||||
function syncWebRtcMemberVolumes(): void {
|
||||
if (!webrtcActive.value || ws.value?.readyState !== WebSocket.OPEN) return;
|
||||
for (const [rawClientId, volume] of Object.entries(volumes)) {
|
||||
const clientId = Number(rawClientId);
|
||||
if (!Number.isInteger(clientId) || clientId <= 0 || volume === 1) continue;
|
||||
if (!Number.isInteger(clientId) || clientId <= 0) continue;
|
||||
sendCmd("setMemberVolume", { clientId, volume });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user