mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 12:02:50 +08:00
fix: improve voice playback, diagnostics and workspace controls
This commit is contained in:
1 parent
72d7e6e013
commit
e82116239a
34 files changed
+502
-147
No files matched your search
@@ -6,6 +6,7 @@ export interface ConnectionFailure {
|
||||
|
||||
interface ConnectionOptions {
|
||||
onSocket(socket: WebSocket | null): void;
|
||||
onSocketOpen?(): void;
|
||||
onMessage(message: unknown): void;
|
||||
onAudio(frame: Uint8Array): void;
|
||||
onClose(event: CloseEvent): void;
|
||||
@@ -72,6 +73,7 @@ export function createVoiceConnection(options: ConnectionOptions) {
|
||||
options.onSocket(socket);
|
||||
socket.onopen = () => {
|
||||
if (!isCurrent(record)) clean(() => socket.close(1000));
|
||||
else options.onSocketOpen?.();
|
||||
};
|
||||
socket.onmessage = event => {
|
||||
if (!isCurrent(record) || record.socket !== socket || socket.readyState !== WebSocket.OPEN) return;
|
||||
|
||||
Reference in new issue
Block a user