Browsers hash deviceIds per frame/origin, so ids from the host's own
enumerateDevices() are unknown in here and select() fell back to the
default. io.lotus.audio_output_state now also carries
available: [{id,label}] (frame-valid ids), so the host's call-bar menu
can offer real choices.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
25 lines
770 B
TypeScript
25 lines
770 B
TypeScript
/*
|
|
Copyright 2026 Lotus Guild
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
Please see LICENSE in the repository root for full details.
|
|
*/
|
|
|
|
import { expect, test } from "vitest";
|
|
|
|
import { audioOutputList } from "./lotusAudioOutput";
|
|
import { type AudioOutputDeviceLabel } from "../state/MediaDevices";
|
|
|
|
test("audioOutputList labels every kind of output (cinny #310)", () => {
|
|
const m = new Map<string, AudioOutputDeviceLabel>([
|
|
["", { type: "default", name: "Speakers" }],
|
|
["a1", { type: "name", name: "Headset" }],
|
|
["a2", { type: "number", number: 3 }],
|
|
]);
|
|
expect(audioOutputList(m)).toEqual([
|
|
{ id: "", label: "Default (Speakers)" },
|
|
{ id: "a1", label: "Headset" },
|
|
{ id: "a2", label: "Output 3" },
|
|
]);
|
|
});
|