37 Commits
Author SHA1 Message Date
MichaelandClaude Opus 5.5 0539ad857f Lecture TV : traverser les silences du panneau sans figer
Télémétrie d'un freeze en prod : le panneau s'est tu ~15-20 s sur une
connexion restée ouverte (aucune reconnexion FFmpeg dans les logs).
Le lecteur n'avait gardé que 11-16 s d'avance — il « consommait » à x1,1
celle que le panneau envoie au démarrage pour revenir à 12 s — puis,
après la coupure de 6,3 s, il repartait avec 1 s de stock et recoupait
aussitôt (1,7 s puis 2,0 s).

- réserve visée 25 s (liveSync 25/35, saut au-delà de 45 s) : ~25 s de
  retard sur le direct en échange de la traversée de ces silences
- après une coupure, attente de 4 s de réserve avant de relire (comme
  mpv cache-pause), 15 s au plus ; une pause utilisateur l'annule ; le
  lecteur lite affiche « Reconstitution de la réserve » au lieu du
  bouton lecture

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 00:04:25 +02:00
MichaelandClaude Opus 5.5 db13c85c1d Lecture : repli CPU quand le GPU sature, plus de spinner infini
Serveur chargé ou VRAM limite : NVENC refuse d'ouvrir l'encodeur
(OpenEncodeSessionEx failed: out of memory), FFmpeg meurt en une
seconde et la playlist part en 502. Chaque relance retombait sur le
même GPU saturé : le flux restait illisible.

- Serveur : un échec imputable au GPU (NVENC, CUDA, mémoire) relance
  la session une fois en libx264, sous le même identifiant — les
  segments suivent sans que le lecteur s'en aperçoive. Direct, VOD et
  enregistrements
- Le GPU est écarté 2 min après une panne : les sessions suivantes
  partent directement sur le CPU au lieu d'échouer une à une
- Source injoignable ou délai dépassé : pas de repli, il doublerait la
  charge d'un serveur déjà occupé
- Process.start qui échoue (serveur à court de ressources) : 502/503
  au lieu d'une exception remontée en 500
- Client : une erreur réseau fatale avant la première playlist
  appelait hls.startLoad(), qui ne relance pas ce chargement → spinner
  infini, aucune erreur, relances de page jamais déclenchées. L'erreur
  remonte désormais à la page
- mpegts.js : au-delà de 3 erreurs en 60 s, bascule sur HLS au lieu de
  recréer sans fin (un FFmpeg neuf toutes les 1,2 s)
- player_lite.html : 3 relances avant l'erreur, comme les autres pages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 21:28:26 +02:00
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 92634dba13 perf: faster stream startup
- Stop sending no-store on vendored player libraries: hls.min.js and
  mpegts.min.js (~750 KB) were re-downloaded on every player open
- hls.js: start with 1 live segment instead of 3, lower buffer-first
  threshold 1.5s -> 0.8s, poll buffer every 100ms
- mpegts.js: initial stash 512KB -> 128KB, start at 0.5s buffered
- Live FFmpeg: -hls_init_time 1 closes the first segment after ~1s

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 11:23:32 +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
MichaelandClaude Opus 4.7 cb5eca7547 fix: add set_volume handler to player_lite.html for mute toggle
player_lite (Live TV desktop) ignored set_volume messages from Flutter,
so mute/unmute button had no effect. Added handler matching player.html.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-03 08:40:48 +02:00
Michael 2f7d709fe6 fix(player): finalize Buffer-First strategy in player_lite.html 2026-03-10 22:13:41 +01: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 118887ab6f perf(player): add MpegTS auto-recovery and optimize initial buffer to prevent Stream Error 2026-03-10 22:02:44 +01:00
Michael b8922a2f08 perf(player): optimize desktop players for micro-cuts and stability 2026-03-10 22:02:13 +01:00
Michael 79fae261aa perf(player): implement Turbo Start for faster zapping while maintaining stability 2026-03-10 21:55:11 +01:00
Michael 9e97f45046 feat(player): increase buffering and stability for HLS and MPEG-TS 2026-03-10 21:30:02 +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 0ae4946816 feat(player): standardize Safari compatibility fixes across all player versions 2026-03-09 22:43:51 +01:00
Michael b69e9d1812 fix(mobile): optimize player UI for mobile portrait and tune HLS buffering 2026-03-09 21:56:56 +01:00
Michael 441597354e fix(mobile): fix orientation reset with IndexedStack, support HLS in Lite player, and optimize fullscreen 2026-03-09 21:35:00 +01:00
Michael 13647a35da feat: Implement TV recording management with API endpoints, a data model, and a scheduling service that uses FFmpeg to record streams. 2026-03-09 16:46:45 +01:00
Michael 2d418e4e0c feat: Add playlist selection screen and basic web IPTV player. 2026-01-01 18:32:39 +01:00
Michael c165ff5d40 feat: Implement IPTV player screen with web iframe integration for live and VOD streams, utilizing player_lite.html for live TV. 2026-01-01 18:26:05 +01:00
Michael 79ad1243fa feat: Add a themed loading screen widget and a web-based HLS/MPEG-TS video player. 2026-01-01 18:21:54 +01:00
Michael 2ca8f5e969 feat: introduce server with API, HLS streaming, Xtream proxy, and player UI 2025-12-14 22:32:15 +01:00
Michael d46714c9bc feat: Add new HTML player pages for streaming video with HLS and MPEG-TS support. 2025-12-14 22:07:07 +01:00
Michael 2eb3304a2b feat: introduce Xtream Codes API service for IPTV content access and streaming. 2025-12-14 21:48:37 +01:00
Michael ee707d3cf9 feat: implement IPTV player screen for live, VOD, and series streams with integrated controls and state management. 2025-12-14 18:47:00 +01:00
Michael a7ca1a087f feat: add Xtream service for IPTV integration and a lite player HTML file. 2025-12-14 16:43:23 +01:00
Michael 781f58cb38 feat: Add IPTV player HTML pages with HLS/MPEG-TS support and parent communication. 2025-12-14 16:24:20 +01:00
Michael 5b0ae63290 feat: Add Xtream Codes API service for managing playlists, streams, and channels, including caching and proxy handling. 2025-12-14 09:13:53 +01:00
Michael 0644f376db feat: implement Xtream Codes API service for managing IPTV connections, streams, and channel data. 2025-12-14 00:17:13 +01:00
Michael 4825745be7 feat: implement IPTV player using a web-based lite player and a dedicated Flutter screen. 2025-12-14 00:01:50 +01:00
Michael ddc0ea64e0 feat: Add IPTV player screen for stream playback with controls, EPG integration, and channel switching. 2025-12-13 13:51:04 +01:00
Michael 67e59b804c feat: add IPTV player screen for stream playback and controls. 2025-12-13 11:41:14 +01:00