From 4e042fb7de16309d4f2d4aa04f13f270a664de73 Mon Sep 17 00:00:00 2001 From: Timothy Date: Sat, 5 Sep 2026 01:46:37 +0200 Subject: [PATCH] fix(554): the hint's cause must be measured, and muting is the consumer's call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Round one measured three defects in the first commit. onAutoplayBlocked fired on ANY rejected video.play(), so the panel could say "autoplay was blocked" when it was not. A play() interrupted by teardown rejects with AbortError — which is exactly what the panel's own Retry produces while the MANIFEST_PARSED play() is still pending — and because the element was muted, a genuine NotAllowedError is the rare case, so the realistic firings were the mislabelled ones. Report only a DOMException named NotAllowedError, on both the MSE and native paths. `muted` was applied to the shared player unconditionally, which silently muted the playback-troubleshooting screen — the tool whose job includes verifying the audio side of an FFmpeg profile, and which the legacy Blazor player never muted. Make it an opt-in `muted` prop defaulting to false; the channel preview passes it, troubleshooting does not, and a test on each side pins its own value. The two clauses hiding the hint once playback starts masked each other: removing either alone left the panel suite green. Every path back to 'starting' (Retry, a channel change) already clears the flag itself, so the clear in onPlaying could never be the load-bearing guard — drop it and let the `state === 'starting'` render guard be the single pinned one. Also cover the native-HLS (Safari) branch, which no test had ever executed: its play() kick, its playing/error wiring, and both autoplay rejection names. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_015QqCpYFsKgnAnx6jVwrKiV --- docs/spa-conventions.md | 38 ++++-- web/src/media/HlsPlayer.test.tsx | 125 +++++++++++++++++- web/src/media/HlsPlayer.tsx | 56 +++++--- .../PlaybackTroubleshootingScreen.test.tsx | 25 ++++ .../channels/ChannelPreviewPanel.test.tsx | 43 +++++- .../screens/channels/ChannelPreviewPanel.tsx | 11 +- 6 files changed, 252 insertions(+), 46 deletions(-) diff --git a/docs/spa-conventions.md b/docs/spa-conventions.md index f7014ab4b..7f1963496 100644 --- a/docs/spa-conventions.md +++ b/docs/spa-conventions.md @@ -643,20 +643,30 @@ safe) and mirrors `onError`'s requirements exactly: pass a **stable** `onPlaying since it too sits in the attach effect's dependency array and an unstable identity would restart the stream every render. -**Autoplay (#554).** The `