fix(media): live radio gets an audio player — the meta carries the init segment's real type

`shade live video` wrote meta.mime from the container alone (video/webm,
video/mp4) before the init segment was seen, so an audio-only stream
(Opus/WebM, AAC/fMP4) played sound in a black 120 px video box. It now
reads until the splitter yields the init and uses its type
(audio/webm; codecs="opus"); the watch page then builds an <audio>, and
sound gets a player bar on the panel instead of a black stage.

Verified in Chromium, unmuted, through the relay: Opus/WebM and AAC/fMP4
radio both play (currentTime advancing, readyState 4) with measured
output (WebAudio RMS 0.044). Media suite 93/0.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-10-18 22:48:00 +02:00
parent f1b4c1ade1
commit 1653060494
6 changed files with 16 additions and 6 deletions

View File

@@ -98,6 +98,9 @@ New package **`@shade/media`** — see `docs/media.md`.
own `WSContext`, and the close handler compared them by identity. A channel
stayed "live" with nobody publishing, and a replaced publisher's socket was
never closed. They are compared by the socket underneath now.
- `shade live video` labelled every stream `video/…`, so a live radio stream
(Opus or AAC alone) played sound in a black video box. The meta now carries
the init segment's type, and the page gives sound an audio player.
- `FileMediaStore` on a directory it could not use rejected at start with no
handler (an unhandled rejection). Now every call fails with the reason.