20 Commits
Author SHA1 Message Date
MichaelandClaude Opus 5 d6c7184475 Lecture : un échec de chargement de mpegts.js n'est plus fatal
L'écran « Échec du chargement : vendor/mpegts.min.js » était un cul-de-sac :
la moindre requête ratée sur la lib condamnait la chaîne, alors que le flux
restait parfaitement lisible autrement.

- xf-player-core : le chargement des libs est retenté une fois en
  contournant le cache HTTP (les libs sont servies en max-age=86400, une
  entrée tronquée bloquait le lecteur jusqu'au vidage manuel du cache), et
  seul un succès est mémorisé — la promesse rejetée restait en cache et
  rendait tout réessai impossible pour le reste de la session.
- Repli automatique : si mpegts.js reste introuvable, le live bascule sur la
  route HLS équivalente (où FFmpeg réencode déjà l'audio en AAC) ; si hls.js
  reste introuvable, on tente le HLS natif. Plus d'écran d'erreur quand un
  chemin de lecture est encore disponible.
- Message d'erreur exploitable : la cause réelle est affichée (HTTP 404,
  429, réseau injoignable) au lieu d'un échec indifférencié.
- Préchargement corrigé : les trois players préchargeaient hls.js en dur,
  soit 618 Ko téléchargés pour rien à chaque zap TV — c'est mpegts.js qui
  sert au direct — au détriment du flux et du chargement de mpegts.js
  lui-même. Le préchargement suit désormais le flux demandé, avec la même
  décision que XFPlayer.start() (et ne charge rien sur Safari/iOS).
- Serveur : avertissement explicite au démarrage si web/vendor/*.min.js
  manque, au lieu de laisser le navigateur échouer sans explication.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014FSovdudi3KBwZK3aC42fw
2026-09-09 16:40:31 +00:00
MichaelandClaude Opus 5 1feeaae78a feat(design): Warm Cinema theme + event-driven adaptive players
Replaces the Projector Noir palette with "Warm Cinema" and rebuilds the
web players around a shared, event-driven engine.

Design
- app_colors: warm charcoal (#0B0908), cream (#F3E9DF), ember (#D9541F);
  adds posterScrim/heroScrim gradients, lift()/emberFocus() shadows,
  const cream-alpha tokens replacing Colors.whiteNN, and primaryFill,
  a deeper ember reserved for text-bearing fills so white labels clear
  the 4.5:1 AA threshold that #D9541F alone does not
- app_theme / mobile_theme: Fraunces (display serif) + Karla (body),
  tighter radii, 20+ component themes
- glass_container: opaque layered surfaces replace the blurred glass
- themed_loading_screen restyled; players and boot splash follow

Performance
- drop every BackdropFilter: backdrop blur forced a full framebuffer
  read per frame per card, the main source of scroll jank
- bundle Fraunces/Karla as assets so google_fonts stops fetching from
  fonts.gstatic.com at startup
- bound image decode size on 12 sites: a 40-poster grid drops from
  ~240 MB to a few tens of MB of GPU memory

Players (new shared engine: web/xf-player-core.js)
- start on media events instead of polling the buffer every 100-200 ms
- hls.js/mpegts.js loaded on demand, so ~213 KB of mpegts is never
  fetched for HLS streams
- liveSyncDurationCount 10 -> 2, startFragPrefetch on, testBandwidth
  off, MPEG-TS initial stash 512 KB -> 64 KB
- adaptive escalation fast -> balanced -> safe after repeated stalls in
  a 60 s window, applied live for HLS so there is no visible cut

Preserved from the recent streaming work on main: server-side quality
selection, stable player viewId, the turbo direct MPEG-TS path, vendored
library cache headers and the CI/Docker changes. Only the theme layer and
the player front-end were replaced; GlassCard stays in ui_components.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 21:42:56 +02:00
MichaelandClaude Fable 5 60d3f42901 feat: security hardening, streaming overhaul, design polish, tests
Security:
- Replace unsalted SHA-256 password hashing with bcrypt (lazy rehash on login)
- Add authenticated /api/xtream-api gateway: Xtream credentials are injected
  server-side and never sent to the frontend; /api/playlists no longer
  returns passwords
- Redact credentials from all logs (login body, proxy/FFmpeg/scheduler URLs)
- Add auth to recordings, EPG, season-passes and streaming routes
  (HttpOnly session cookie for hls.js; loopback bypass for local FFmpeg)
- Lock player postMessage to same-origin in both directions
- Vendor and pin hls.js 1.6.7 / mpegts.js 1.7.3 (drop CDN @latest)
- Fix rate limiter (client IP was never resolved), add login rate limit,
  restrict CORS, add CSP Report-Only, block private-IP SSRF targets,
  fix path traversal in recording log retrieval, chmod 777 -> 770
- Remove dead HiveService (seeded admin/admin into IndexedDB with SHA-256)
- Fix authMiddleware not populating 'user' context (getPlaylist ignored the
  logged-in user; admin purge always returned 403)

Streaming:
- New FfmpegSessionManager: process registry, idle reaper (4 min live /
  15 min VOD), orphan cleanup at startup, clean SIGTERM shutdown,
  fast-fail with stderr instead of 30 s timeout
- Quality selection (source/high/medium/low) for live and VOD; source mode
  streams with -c:v copy (zero transcoding); selector wired into the player
- Concurrent recordings (MAX_CONCURRENT_RECORDINGS, default 2); conflicts
  retry on the next tick instead of silently failing
- Lower live latency (HLS window 20 -> 10 segments, liveSync 10 -> 3)
- Fix recording log lookup (.mp4 vs .mkv mismatch)

Design:
- Replace hardcoded colors with AppColors tokens (12 files)
- web/theme.css syncs HTML players with the Flutter palette
- DPAD/keyboard navigation (arrow-key focus, player shortcuts)
- Tooltips on player icon buttons, Semantics on content cards
- Remove 7 dead widgets broken since the Stitch merge

Quality:
- bin/test/: 21 unit tests (bcrypt, redaction, traversal, SSRF, recording
  conflicts) plus a quality-selector widget test
- GitHub Actions CI (analyze + test + build web)
- Archive stale status docs into docs/archive/

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 10:07:18 +02:00
Michael ddb8110c40 feat: add mobile scaffold layout and dedicated mobile video player implementation 2026-03-29 12:07:14 +02:00
Michael 36a7658cf9 feat: add mobile-optimized video player and streaming API handler 2026-03-29 11:47:09 +02:00
Michael db2eab0e66 feat: add mobile-optimized IPTV player with HLS and MpegTS support 2026-03-29 10:36:37 +02:00
Michael fa6ae90d8d feat: add mobile-optimized IPTV player with HLS and MpegTS support 2026-03-29 10:19:36 +02:00
Michael 893ae7b03a perf(player): switch to Buffer-First strategy to eliminate chaotic startup and micro-cuts 2026-03-10 22:08:20 +01:00
Michael 2ef1db8a68 perf(proxy): enable Keep-Alive and playlist caching to fix 5s zap delay; tuned mobile player for micro-cuts 2026-03-10 22:01:52 +01:00
Michael 79fae261aa perf(player): implement Turbo Start for faster zapping while maintaining stability 2026-03-10 21:55:11 +01:00
Michael a8d2a5446d perf: implement robust playback stabilization to fix choppy video
- Increased MPEG-TS stashInitialSize to 1MB for better jitter resistance
- Enabled HLS.js discontinuity nudging to prevent freezing on corrupt segments
- Smoothed latency chasing with 1.1x playback rate
- Increased HLS sync distance to 6 segments for improved stability
2026-03-10 19:25:02 +01:00
Michael df4bcfd07f fix: stabilize IPTV playback and implement request throttling
- Add playback lock to XtreamService to delay EPG during stream init
- Increase MPEG-TS stash buffer to 512KB for better stability
- Enable liveBufferLatencyChasing to prevent stream drift
- Tune HLS parameters for balanced speed and reliability
2026-03-10 18:54:44 +01:00
Michael 0ca6f96710 feat: implement Turbo-Start stream acceleration
- Add direct MPEG-TS support and optimized HLS tuning
- Implement low-latency sync and instant bitrate selection
- Achieve TiviMate-like zapping speed by reducing initial buffers
2026-03-10 18:41:46 +01:00
Michael 736ab0f51c chore: optimize IPTV performance and fix navigation Loop
- Revert aggressive caching in XtreamService (use forceCache + 1h stale)
- Adjust HLS.js buffers (60s-120s) for stream stability
- Fix desktop navigation loop in PlaylistSelectionScreen
- Fix receive timeouts (revert to 30s/60s)
2026-03-10 18:28:10 +01:00
Michael 33d0e0a80d fix(streaming): optimize quality, audio sync, and content update refresh
- Increased FFmpeg video quality to 8Mbps and audio to 192kbps.
- Added audio resync filters and better presets.
- Optimized HLS buffer settings for mobile players to reduce interruptions.
- Reduced API cache duration to 15m and added refresh support for faster content updates.
2026-03-10 10:26:24 +01:00
Michael a256ca87b6 fix(player): resolve Safari infinite loading by refining play overlay and loading logic 2026-03-09 23:05:10 +01:00
Michael dbb6559640 fix(player): restore missing stream variables in player_mobile.html to fix infinite loading 2026-03-09 22:56:27 +01:00
Michael 3ef4884336 feat(player): remove non-functional fullscreen button as requested 2026-03-09 22:52:05 +01:00
Michael 105496d243 feat(player): improve Safari/iOS compatibility with manual play overlay and robust loading 2026-03-09 22:40:58 +01:00
Michael 19a0755e01 feat(mobile): dedicated mobile player and responsive UI improvements 2026-03-09 22:14:33 +01:00