Skip to content

fix(player): bound playback init so a stalled stream can't spin forever#58

Merged
windoze95 merged 1 commit into
mainfrom
fix/playback-init-timeout
Jun 29, 2026
Merged

fix(player): bound playback init so a stalled stream can't spin forever#58
windoze95 merged 1 commit into
mainfrom
fix/playback-init-timeout

Conversation

@windoze95

Copy link
Copy Markdown
Owner

Bug

Tapping some episodes sometimes just spins on "Preparing your video…" with no recovery.

Root cause

VideoPlayerController.initialize() in _startPlayback had no timeout. The cold-press path awaits the instant-stream proxy; if that stalls (see the backend fix windoze95/nullfeed-backend#93), the await never completes — so it never returns to fall through to the preview fallback (which does have graceful 90s/180s timeouts). Result: an indefinite spinner.

Fix

Bound controller.initialize() at playbackInitTimeoutSeconds (25s). A timeout is treated as a load failure:

  • cold-press / instant-stream (reportErrors: false) → returns false → falls back to the preview path (bounded + graceful error),
  • HQ / preview paths → surface the "taking longer than expected" error.

So no playback path can hang forever, regardless of backend behavior. Defense-in-depth with the backend's first-byte cap.

Verification

flutter analyze --fatal-infos --fatal-warnings → No issues; flutter test156 passed; flutter build web → succeeds.

🤖 Generated with Claude Code

`controller.initialize()` had no timeout, so a wedged instant-stream proxy (or
any stalled source) left the player stuck on "Preparing your video…"
indefinitely — the preview fallback, with its own graceful timeouts, was never
reached because the instant-stream await never completed.

Cap initialize at playbackInitTimeoutSeconds (25s). On timeout it's treated as a
load failure: the cold-press (instant-stream) path falls back to a preview
(reportErrors: false), other paths surface the graceful error. No path can hang
forever now.

analyze clean, 156 tests pass, flutter build web succeeds.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@windoze95 windoze95 merged commit 7b5d996 into main Jun 29, 2026
7 checks passed
@windoze95 windoze95 deleted the fix/playback-init-timeout branch June 29, 2026 14:41
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