Skip to content

feat: inline player with Web/MPV engine selection#393

Closed
wowitsjack wants to merge 1 commit intoFredolx:mainfrom
wowitsjack:feat/inline-player
Closed

feat: inline player with Web/MPV engine selection#393
wowitsjack wants to merge 1 commit intoFredolx:mainfrom
wowitsjack:feat/inline-player

Conversation

@wowitsjack
Copy link

@wowitsjack wowitsjack commented Mar 7, 2026

Full source available at FredTV-Next, my personal fork with all features integrated.

Summary

  • Adds an inline video player component supporting Web (hls.js) and Embedded MPV playback engines alongside the existing External MPV
  • New local_player.rs backend proxies streams via ffmpeg to localhost for the inline player
  • Player engine is configurable in Settings (Web Player / Embedded MPV / External MPV)
  • Channel clicks now route to the inline player for Web/EmbeddedMpv engines, or to the legacy external MPV for ExternalMpv

New in this update

  • Fix: proxy manifest caching - Warp server now serves stream.m3u8 with Cache-Control: no-cache headers, fixing the 6-second buffer starvation bug on proxy-routed streams
  • Direct HLS for redirect streams - get_stream_info resolves 302 redirect chains via HEAD request, enabling direct HLS playback for streams like tvpass.org without the ffmpeg proxy
  • Automatic proxy fallback - If direct HLS hits a fatal network error (CORS, etc.), player falls back to the ffmpeg proxy automatically
  • HLS.js tuning - Configurable buffer sizes, lower liveSyncDurationCount for proxy streams, xhrSetup cache-busting on manifest requests
  • Buffer size setting - New user-facing buffer size selector in Settings (Low/Medium/High/Maximum)
  • HTTP client module - Centralized http.rs with proxy/UA/timeout support
  • Scheduler module - EPG and source refresh scheduling
  • Backup module - Export/import full backups

Dependencies

Stacked on #392 (feat/recording-system) - merge that first, then this PR's diff auto-narrows.

New files

  • src-tauri/src/local_player.rs - ffmpeg stream proxy backend with no-cache manifest serving
  • src-tauri/src/http.rs - centralized HTTP client builder
  • src-tauri/src/backup.rs - backup export/import
  • src-tauri/src/scheduler.rs - EPG and source refresh scheduler
  • src/app/inline-player/ - Angular inline player component (ts/html/css)
  • src/app/models/playerEngine.ts - PlayerEngine enum
  • src/app/models/playerState.ts - PlayerState enum

Modified files

  • src-tauri/src/lib.rs - local_player module, new commands, ExitRequested handler, scheduler init
  • src-tauri/src/types.rs - StreamInfo (with resolved_url), buffer_size in Settings, AppState
  • src-tauri/src/settings.rs - player_engine, buffer_size, connection_timeout persistence
  • src-tauri/src/m3u.rs - uses centralized http client
  • src-tauri/src/restream.rs - uses centralized http client
  • src-tauri/src/utils.rs - uses centralized http client
  • src-tauri/src/xtream.rs - uses centralized http client
  • src/app/channel-tile/channel-tile.component.ts - click() refactored for engine routing
  • src/app/memory.service.ts - NowPlaying, PlayerState, PlayerEngine subjects
  • src/app/settings/settings.component.ts + .html - player engine selector, buffer size
  • src/app/models/settings.ts - buffer_size, enable_gpu, enable_hwdec fields
  • src/app/app.component.ts - PlayerState subscription

Test plan

  • Select "Web Player" in Settings, click a livestream -> plays inline via hls.js
  • Proxy streams (Disney Channel via tvpass.org): manifest refreshes, no 6-second stall
  • Redirect streams: resolved via HEAD, direct HLS playback without proxy
  • Direct HLS failure: automatic fallback to proxy, no user-visible error
  • Normal .m3u8 streams: unchanged behavior
  • Streams with custom headers: still routed through proxy
  • Buffer size setting works across Low/Medium/High/Maximum
  • cargo check and npx ng build both pass

@CLAassistant
Copy link

CLAassistant commented Mar 7, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


wowitsjack seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@wowitsjack
Copy link
Author

wowitsjack commented Mar 7, 2026

Yep agreed

@wowitsjack wowitsjack force-pushed the feat/inline-player branch 2 times, most recently from 1e4a7d6 to 2d8da19 Compare March 7, 2026 15:54
Add HLS.js-based web player and embedded MPV engine for in-app
video playback. Local MPEG-TS proxy via ffmpeg+warp for streams
that need transcoding. Engine selection in settings.
@wowitsjack wowitsjack force-pushed the feat/inline-player branch from 2d8da19 to 837f935 Compare March 7, 2026 17:11
@wowitsjack
Copy link
Author

Superseded by #396 + #397 which contribute the full FredTV-Next codebase as a proper 2-part stack.

@wowitsjack wowitsjack closed this Mar 7, 2026
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.

2 participants