fix(player): show an error state when media fails to load#298
Merged
Conversation
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.
Deploying podnotes with
|
| 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 |
There was a problem hiding this comment.
💡 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".
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
isLoadingwas cleared only byloadedmetadata, and neither media element had anerrorhandler - 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).