mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-02 19:42:51 +08:00
feat(kaak): match KOOK audio device picker
This commit is contained in:
1 parent
70cc6c3bbf
commit
8e580e7e18
15 files changed
+408
-59
No files matched your search
@@ -106,19 +106,21 @@ export function useWebClientAudioControls({
|
||||
setNotificationVolume(Number((event.target as HTMLInputElement).value) / 100);
|
||||
}
|
||||
|
||||
async function onInputDeviceChange(event: Event): Promise<void> {
|
||||
async function onInputDeviceChange(selection: Event | string): Promise<void> {
|
||||
const isCurrent = beginSettingsRequest();
|
||||
try {
|
||||
await setInputDevice((event.target as HTMLSelectElement).value);
|
||||
const deviceId = typeof selection === "string" ? selection : (selection.target as HTMLSelectElement).value;
|
||||
await setInputDevice(deviceId);
|
||||
} catch (error: unknown) {
|
||||
if (isCurrent()) settingsError.value = microphoneErrorMessage(error, "无法切换麦克风");
|
||||
}
|
||||
}
|
||||
|
||||
async function onOutputDeviceChange(event: Event): Promise<void> {
|
||||
async function onOutputDeviceChange(selection: Event | string): Promise<void> {
|
||||
const isCurrent = beginSettingsRequest();
|
||||
try {
|
||||
await setOutputDevice((event.target as HTMLSelectElement).value);
|
||||
const deviceId = typeof selection === "string" ? selection : (selection.target as HTMLSelectElement).value;
|
||||
await setOutputDevice(deviceId);
|
||||
} catch (error: unknown) {
|
||||
if (isCurrent()) settingsError.value = localizedMessage(error instanceof Error ? error.message : "无法切换扬声器");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user