mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 03:52:50 +08:00
fix: preserve WebRTC playback diagnostics
This commit is contained in:
1 parent
4d4d4cdeb1
commit
059435f4cb
1 file changed
+8
-2
@@ -580,7 +580,11 @@ export class VoiceBridge {
|
||||
if (isWebRtcStopMessage(rawMessage)) {
|
||||
const webRtc = entry!.webrtc;
|
||||
entry!.webrtc = null;
|
||||
if (webRtc) void webRtc.close();
|
||||
if (webRtc) {
|
||||
void webRtc.close()
|
||||
.then(() => Object.assign(entry!.audio, webRtc.getStats()))
|
||||
.catch(() => undefined);
|
||||
}
|
||||
return;
|
||||
}
|
||||
const command = parseClientCommand(rawMessage);
|
||||
@@ -746,7 +750,9 @@ export class VoiceBridge {
|
||||
sendJson: (message: Record<string, unknown>) => void,
|
||||
): Promise<void> {
|
||||
if (entry.webrtc) {
|
||||
try { await entry.webrtc.close(); } catch { /* replace a retried offer */ }
|
||||
const previousWebRtc = entry.webrtc;
|
||||
try { await previousWebRtc.close(); } catch { /* replace a retried offer */ }
|
||||
Object.assign(entry.audio, previousWebRtc.getStats());
|
||||
entry.webrtc = null;
|
||||
}
|
||||
const config = this.getWebRtcOptions();
|
||||
|
||||
Reference in new issue
Block a user