Skip to content

fix(player): show an error state when media fails to load#298

Merged
chhoumann merged 2 commits into
masterfrom
fix/blocked-media-loading-state
Jul 11, 2026
Merged

fix(player): show an error state when media fails to load#298
chhoumann merged 2 commits into
masterfrom
fix/blocked-media-loading-state

Conversation

@chhoumann

Copy link
Copy Markdown
Owner

isLoading was cleared only by loadedmetadata, and neither media element had an error handler - a blocked, dead, or unreachable stream URL left the player's loading spinner up forever with no way to tell it apart from a slow connection.

Both the audio and video elements now handle error: the spinner is replaced by a visible error overlay ("Could not load this episode's media") with an alert role, and the state resets when the next episode loads. Found while routing all outbound requests through the network gate (#290), where a refused URL surfaces exactly this way; it equally covers ordinary dead links.

Two component tests: error replaces the spinner; switching episodes clears the error. Full gates green (1,131 tests).

isLoading was cleared only by loadedmetadata, and the media elements had
no error handler - a blocked, dead, or unreachable stream URL left the
player spinning forever. Both media elements now handle error by
replacing the spinner with a visible error overlay; the state resets on
the next episode switch. Found while gating all outbound requests (#290):
a refused stream URL looked identical to a slow one.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 11, 2026

Copy link
Copy Markdown

Deploying podnotes with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0f2574b
Status: ✅  Deploy successful!
Preview URL: https://ab24ffe6.podnotes.pages.dev
Branch Preview URL: https://fix-blocked-media-loading-st.podnotes.pages.dev

View logs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8d29813138

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/ui/PodcastView/EpisodePlayer.svelte
Addressing review: onMediaError cleared isLoading, but isLoading also
gated persistPlaybackPosition, so a failed load (which never restores the
saved position) could let a later pause/destroy write the pre-restore 0
over the stored resume point. Split the concerns: isLoading stays a pure
display flag; a dedicated playbackRestored guard, set only by a real
metadata load, gates persistence. Regression test: a failed load followed
by unmount keeps the saved position intact.
@chhoumann chhoumann merged commit 7f84431 into master Jul 11, 2026
6 checks passed
@chhoumann chhoumann deleted the fix/blocked-media-loading-state branch July 11, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant