Skip to content

Reduce player resource usage and streamline builds - #3

Merged
pushpinderbal merged 4 commits into
mainfrom
cleanup/player-performance
Sep 30, 2026
Merged

pushpinderbal merged 4 commits into
mainfrom
cleanup/player-performance

Conversation

@pushpinderbal

@pushpinderbal pushpinderbal commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Playback currently loads the whole HLS decoder during startup and keeps large media buffers. This change loads HLS and Settings on demand, prefers native HLS when supported with a decoder fallback for stream-specific failures, and releases media and workers when playback closes or fails. Initial JavaScript falls from about 1,135 kB to 600 kB, and CSS falls from 69.5 kB to 51.7 kB.

Changes

  • Limit HLS buffers to roughly 30 seconds ahead and behind playback, support local native buffered seeks, reduce status polling, and cap and pause the decorative canvas during playback.
  • Remove unused components, assets, styles, backend helpers, and 34 dependency packages. Use scoped Radix packages and the shared button component.
  • Fix playback directory cleanup and database cleanup on initialization failure. Remove the FFMPEG_PATH and FFPROBE_PATH overrides; use the installed executables automatically.
  • Build the frontend once for multi-platform Docker images, cross-compile Go on the build host, add build caches, and restore pull-request test/build checks with FFmpeg installed for playback integration tests.
  • Run browser tests against production assets with two workers, keep screenshots opt-in, and cover native playback, delayed decoder loading, and fatal playback cleanup.
  • Rewrite the README around provider requirements, Docker/Compose setup, usage, and the environment settings with explicit required values and defaults.

Validation

  • Uncached Go integration tests, go vet, and Go race tests in a temporary build container.
  • Frozen Bun install, TypeScript checks, and production frontend build.
  • Browser suite: 53 passed; the optional visual screenshot test skipped.
  • Real FFmpeg-to-Chrome playback through both HLS.js and native HLS, including native decode failure fallback, seeking, and media/worker cleanup. The reported provider episode was also verified in the development app.
  • Production Docker build and HTTP/API/asset smoke checks; amd64 and arm64 backend cross-compilation.
  • Compose configuration and whitespace checks.

The optional full HLS decoder remains about 523 kB and still triggers Vite's 500 kB warning. It is retained for codec compatibility. Buffer limits are duration-based; native media buffering remains managed by the browser.

@pushpinderbal
pushpinderbal merged commit 710c402 into main Sep 30, 2026
2 checks passed
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