feat(lotus): report the frame's audio outputs to the host (cinny #310)
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
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
eb59fd5b3f
commit
34d541b707
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
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" },
|
||||
]);
|
||||
});
|
||||
Reference in New Issue
Block a user