Commit Graph
46 Commits
Author SHA1 Message Date
Claude fa8eed38f2 Enregistrements : corriger le démarrage de la lecture
La lecture d'un enregistrement démarrait au milieu du programme et se
coupait aussitôt ; il fallait relancer une deuxième fois pour qu'elle
tienne.

Cause principale, introduite avec le passage de la playlist en `EVENT` :
tant que le transcodage n'est pas terminé, la playlist n'a pas
d'`EXT-X-ENDLIST`, et hls.js traite alors tout contenu comme du direct.
Sans `startPosition` explicite il démarre au « bord du direct » — donc
collé au front d'encodage, sans la moindre avance de segments. D'où un
départ en plein milieu, puis une coupure immédiate. Au second essai, le
transcodage était terminé (ENDLIST présent, contenu traité en VOD) et
tout se passait bien.

Hors direct : `startPosition: 0` (ou la position de reprise), rattrapage
de latence neutralisé (il accélérait la lecture puis forçait un saut en
avant vers un direct inexistant), et délai d'attente de playlist porté de
10 s à 45 s — une session FFmpeg qui démarre n'est plus prise pour un
manifeste mort.

Cause de fond : la lecture ré-encodait la vidéo. Or la capture se fait en
`-c copy`, donc le fichier contient le codec de la chaîne, presque
toujours du H.264, directement lisible en HLS. Le ré-encodage tenait à
peine le temps réel en 1080p, ce qui laissait le lecteur courir après
l'encodeur en permanence. La vidéo est désormais copiée telle quelle
quand elle est en H.264 (seul l'audio est converti en AAC) : la
segmentation va à la vitesse du disque, l'enregistrement devient
navigable en quelques secondes et les sauts ne redémarrent presque plus
jamais FFmpeg. Les codecs que le navigateur ne sait pas lire (HEVC,
MPEG-2…) restent ré-encodés.

En complément :
- le serveur attend trois segments d'avance avant de servir la playlist,
  et sert ce qu'il a plutôt qu'une erreur si le délai expire ;
- le lecteur de bureau réessaie seul jusqu'à 3 fois, comme le lecteur
  mobile le faisait déjà ;
- `XFPlayer.destroy()` retire ses écouteurs : sans ça, une relance
  laissait l'instance précédente réagir aux commandes du parent et
  republier des positions périmées ;
- les appels ffprobe passent par `MediaProbe`, qui mémorise durée et
  codec tant que le fichier ne change pas.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T1A6WRnoktWcT7ZG4b2rbC
2026-09-10 17:48:02 +00: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
Michael e641d04a3a feat: implement streaming handler with FFmpeg-based live and VOD HLS transcoding support 2026-04-01 21:35:25 +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 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 a256ca87b6 fix(player): resolve Safari infinite loading by refining play overlay and loading logic 2026-03-09 23:05:10 +01:00
Michael 3ef4884336 feat(player): remove non-functional fullscreen button as requested 2026-03-09 22:52:05 +01:00
Michael 0ae4946816 feat(player): standardize Safari compatibility fixes across all player versions 2026-03-09 22:43:51 +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 d1401711af feat: Implement Xtream Codes IPTV streaming, VOD transcoding, and content browsing UI with a dedicated web player. 2025-12-15 21:18:36 +01:00
Michael b39dd97e5a feat: Add local Docker test environment setup with PowerShell script and Docker Compose. 2025-12-15 20:56:17 +01:00
Michael 301dbbec2d feat: add web-based streaming player with HLS/MPEG-TS support and streaming API handler 2025-12-15 17:00:55 +01:00
Michael f290f5a7fc feat: Add initial IPTV player with web-based playback and streaming API. 2025-12-15 13:01:24 +01:00
Michael 1d6fbfbe0e feat: Add new HTML player pages for streaming video with HLS and MPEG-TS support. 2025-12-14 22:07:07 +01:00
Michael b0de7bce86 feat: introduce Xtream Codes API service for IPTV content access and streaming. 2025-12-14 21:48:37 +01:00
Michael 4ea1c2978b feat: Implement HLS streaming with file serving and FFmpeg transcoding for live and VOD content. 2025-12-14 18:26:44 +01:00
Michael 610c0064c1 feat: Add IPTV player HTML pages with HLS/MPEG-TS support and parent communication. 2025-12-14 16:24:20 +01:00
Michael 41c4ab05aa feat: Add initial IPTV player with HLS.js and mpegts.js support, including UI and parent communication. 2025-12-14 16:05:30 +01:00
Michael 85deb540d2 feat: implement Xtream Codes API service for managing IPTV connections, streams, and channel data. 2025-12-14 00:17:13 +01:00
Michael c722a73d50 feat: add IPTV player with HLS/mpegts support, loading/error UI, and parent window communication. 2025-12-08 23:35:24 +01:00
Michael e586972d22 feat: Add initial IPTV player with HLS.js and mpegts.js support for video playback and parent communication. 2025-12-08 23:21:25 +01:00
Michael d48d25f65e feat(iptv): introduce web-based video player screen for live, VOD, and series content 2025-12-08 20:10:40 +01:00
Michael 10230aa131 build: Add build log file. 2025-12-08 15:04:04 +01:00
Michael 6b992d3b2e feat: implement web-based IPTV player with HLS.js and mpegts.js, including parent communication for control and status. 2025-12-07 16:07:06 +01:00
Michael 716eeb5c57 feat: Add mobile settings tab UI with user profile, appearance, and streaming options 2025-12-07 15:44:22 +01:00
Michael 703193870f feat: add IPTV player with HLS.js and mpegts.js for stream playback and parent communication. 2025-12-07 15:05:01 +01:00
Michael 5b1cd36737 feat: Add initial IPTV player with HLS/MPEG-TS support, query parameter parsing, and parent window communication. 2025-12-07 14:57:32 +01:00
Michael 04ea24e42b feat: implement IPTV player with HLS.js and mpegts.js, supporting stream playback, loading/error states, and parent window communication. 2025-12-07 10:20:42 +01:00
Michael 2e2bd2b0ad feat: add IPTV player screen supporting live, VOD, and series streams via HTML iframe, and update dependencies. 2025-12-07 10:15:08 +01:00
Michael d056877b9e feat: Add IPTV player screen with live stream FFmpeg transcoding, playback position tracking, and new dashboard and digital clock widgets. 2025-12-07 10:02:54 +01:00
Michael 951b5f86c5 feat: introduce Live TV tab for browsing IPTV channels with category filtering, search, and favorites. 2025-12-06 23:28:34 +01:00
Michael e699d3ec31 feat: Introduce core IPTV features, authentication screen, web player, and application theming. 2025-12-06 18:19:21 +01:00
Michael f237597dd8 feat: add LiveTVTab widget for displaying categorized live TV channels with pagination. 2025-12-06 15:28:05 +01:00
Michael c763e53972 feat: Add IPTV player screen with FFmpeg transcoding, resume playback, and dedicated movie/series tabs. 2025-12-06 14:10:52 +01:00
Michael a01bbb1a1c feat: add IPTV player with HLS and MPEG-TS support 2025-12-06 12:58:21 +01:00
Michael cda9baee39 feat: Implement Xtream service for IPTV API integration and add a web player. 2025-12-06 11:34:47 +01:00
Michael 2bef149b5d feat: implement IPTV player screen with mpegts.js for web streams 2025-12-06 10:51:30 +01:00