refactor(mediabunny): [PKG-MB-08] finish typed media capability boundaries

This commit is contained in:
Harvey Zhao committed 2026-09-12 21:51:47 +08:00
1 parent 5e28dfee95
commit fb9fb23f53
25 files changed
+2698 -30

No files matched your search

@@ -1,5 +1,14 @@
import type { PlaybackHost } from './engine-ports'
import type EventTarget from './EventTarget'
export function requireDecoder(host: Pick<PlaybackHost, 'audio' | 'video' | 'readyState'>): void {
// Sinks reflect the decoder's completed capability check; do not query the SDK twice.
if (host.audio.audioSink || host.video.videoSink)
return
host.readyState = 0
throw new Error('Input has no decodable audio or video tracks.')
}
export function publish(events: EventTarget, current: () => boolean, names: readonly string[]): void {
for (const name of names) {
if (!current())