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>
This commit is contained in:
MichaelandClaude Opus 5 committed 2026-08-10 21:42:56 +02:00
1 parent e332895d7d
commit 1feeaae78a
49 files changed
+2341 -1751

No files matched your search

+31 -31
View File
@@ -535,7 +535,7 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
'Unknown')
.toString()
: widget.title,
style: GoogleFonts.syne(
style: GoogleFonts.fraunces(
color: AppColors.textPrimary,
fontSize: 18,
fontWeight: FontWeight.w600,
@@ -544,7 +544,7 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
),
Text(
'Live TV',
style: GoogleFonts.instrumentSans(
style: GoogleFonts.karla(
color: AppColors.primary,
fontSize: 12,
fontWeight: FontWeight.bold,
@@ -601,7 +601,7 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
_buildInlineEpg(),
const SizedBox(height: 12),
const Divider(
color: Colors.white10,
color: AppColors.onSurface06,
),
const SizedBox(height: 8),
// Control Buttons
@@ -706,10 +706,10 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
Expanded(
child: Text(
widget.title,
style: GoogleFonts.syne(
style: GoogleFonts.fraunces(
fontSize: 20,
fontWeight: FontWeight.w600,
color: Colors.white,
color: AppColors.onSurface,
),
),
),
@@ -733,7 +733,7 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
right: 40,
child: GlassContainer.glass(
borderRadius: 24,
borderColor: Colors.white.withOpacity(0.1),
borderColor: AppColors.onSurface.withOpacity(0.1),
padding: const EdgeInsets.all(24),
child: Column(
mainAxisSize: MainAxisSize.min,
@@ -747,8 +747,8 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
seconds: _currentPosition.toInt(),
),
),
style: GoogleFonts.instrumentSans(
color: Colors.white70,
style: GoogleFonts.karla(
color: AppColors.onSurfaceVariant,
),
),
const SizedBox(width: 16),
@@ -758,8 +758,8 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
trackHeight: 4,
activeTrackColor: AppColors.primary,
inactiveTrackColor:
Colors.white.withOpacity(0.2),
thumbColor: Colors.white,
AppColors.onSurface.withOpacity(0.2),
thumbColor: AppColors.onSurface,
thumbShape: const RoundSliderThumbShape(
enabledThumbRadius: 8,
),
@@ -799,8 +799,8 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
seconds: _totalDuration.toInt(),
),
),
style: GoogleFonts.instrumentSans(
color: Colors.white70,
style: GoogleFonts.karla(
color: AppColors.onSurfaceVariant,
),
),
],
@@ -892,7 +892,7 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
}) {
// Button with direct Material/InkWell - PointerInterceptor is on outer container
final button = Material(
color: transparent ? Colors.transparent : Colors.white.withOpacity(0.1),
color: transparent ? Colors.transparent : AppColors.onSurface.withOpacity(0.1),
shape: const CircleBorder(),
child: InkWell(
onTap: onTap,
@@ -905,9 +905,9 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
shape: BoxShape.circle,
border: transparent
? null
: Border.all(color: Colors.white.withOpacity(0.1)),
: Border.all(color: AppColors.onSurface.withOpacity(0.1)),
),
child: Icon(icon, color: Colors.white, size: iconSize),
child: Icon(icon, color: AppColors.onSurface, size: iconSize),
),
),
);
@@ -987,7 +987,7 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
final button = Material(
color: highlighted
? AppColors.primary.withOpacity(0.2)
: Colors.white.withOpacity(0.1),
: AppColors.onSurface.withOpacity(0.1),
shape: const CircleBorder(),
child: InkWell(
onTap: onTap,
@@ -1003,13 +1003,13 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
border: Border.all(
color: highlighted
? AppColors.primary.withOpacity(0.5)
: Colors.white.withOpacity(0.2),
: AppColors.onSurface.withOpacity(0.2),
width: highlighted ? 2 : 1,
),
),
child: Icon(
icon,
color: highlighted ? AppColors.primary : Colors.white,
color: highlighted ? AppColors.primary : AppColors.onSurface,
size: iconSize,
),
),
@@ -1048,7 +1048,7 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
child: const Text(
'LIVE',
style: TextStyle(
color: Colors.white,
color: AppColors.onSurface,
fontSize: 11,
fontWeight: FontWeight.bold,
),
@@ -1060,8 +1060,8 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
widget.channels != null
? widget.channels![_currentIndex].name
: widget.title,
style: GoogleFonts.syne(
color: Colors.white,
style: GoogleFonts.fraunces(
color: AppColors.onSurface,
fontSize: 16,
fontWeight: FontWeight.w600,
),
@@ -1096,7 +1096,7 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
child: const Text(
'LIVE',
style: TextStyle(
color: Colors.white,
color: AppColors.onSurface,
fontSize: 11,
fontWeight: FontWeight.bold,
),
@@ -1110,8 +1110,8 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
children: [
Text(
currentProgram.title,
style: GoogleFonts.syne(
color: Colors.white,
style: GoogleFonts.fraunces(
color: AppColors.onSurface,
fontSize: 15,
fontWeight: FontWeight.w600,
),
@@ -1121,8 +1121,8 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
if (currentProgram.description.isNotEmpty)
Text(
currentProgram.description,
style: GoogleFonts.instrumentSans(
color: Colors.white60,
style: GoogleFonts.karla(
color: AppColors.onSurface54,
fontSize: 12,
),
maxLines: 1,
@@ -1145,7 +1145,7 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
child: const Text(
'LIVE',
style: TextStyle(
color: Colors.white,
color: AppColors.onSurface,
fontSize: 11,
fontWeight: FontWeight.bold,
),
@@ -1156,8 +1156,8 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
widget.channels != null
? widget.channels![_currentIndex].name
: widget.title,
style: GoogleFonts.syne(
color: Colors.white,
style: GoogleFonts.fraunces(
color: AppColors.onSurface,
fontSize: 16,
fontWeight: FontWeight.w600,
),
@@ -1168,8 +1168,8 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
widget.channels != null
? widget.channels![_currentIndex].name
: widget.title,
style: GoogleFonts.syne(
color: Colors.white,
style: GoogleFonts.fraunces(
color: AppColors.onSurface,
fontSize: 16,
fontWeight: FontWeight.w600,
),
@@ -27,7 +27,7 @@ class PlaylistSelectionScreen extends ConsumerWidget {
appBar: AppBar(
title: Text(
'Select Playlist',
style: GoogleFonts.roboto(
style: GoogleFonts.karla(
fontWeight: FontWeight.w600,
color: AppColors.textPrimary,
),
@@ -97,7 +97,7 @@ class PlaylistSelectionScreen extends ConsumerWidget {
const SizedBox(height: 16),
Text(
'Error loading playlists',
style: GoogleFonts.syne(
style: GoogleFonts.fraunces(
fontSize: 18,
color: AppColors.textSecondary,
),
@@ -109,7 +109,7 @@ class PlaylistSelectionScreen extends ConsumerWidget {
backgroundColor: AppColors.primary,
foregroundColor: AppColors.textPrimary,
),
child: Text('Retry', style: GoogleFonts.instrumentSans()),
child: Text('Retry', style: GoogleFonts.karla()),
),
],
),
@@ -123,14 +123,14 @@ class PlaylistSelectionScreen extends ConsumerWidget {
const Icon(
Icons.playlist_remove,
size: 64,
color: Colors.white24,
color: AppColors.onSurface24,
),
const SizedBox(height: 16),
Text(
'No playlists available',
style: GoogleFonts.syne(
style: GoogleFonts.fraunces(
fontSize: 18,
color: Colors.white60,
color: AppColors.onSurface54,
),
),
const SizedBox(height: 8),
@@ -138,9 +138,9 @@ class PlaylistSelectionScreen extends ConsumerWidget {
currentUser?.isAdmin ?? false
? 'Add playlists in Admin Panel'
: 'Contact administrator',
style: GoogleFonts.instrumentSans(
style: GoogleFonts.karla(
fontSize: 14,
color: Colors.white38,
color: AppColors.onSurface38,
),
),
],
@@ -209,13 +209,13 @@ class _PlaylistCardState extends State<_PlaylistCard> {
duration: const Duration(milliseconds: 200),
decoration: BoxDecoration(
color: _isHovered
? Colors.white.withOpacity(0.1)
: Colors.white.withOpacity(0.03),
? AppColors.onSurface.withOpacity(0.1)
: AppColors.onSurface.withOpacity(0.03),
borderRadius: BorderRadius.circular(24),
border: Border.all(
color: _isHovered
? AppColors.primary.withOpacity(0.5)
: Colors.white.withOpacity(0.08),
: AppColors.onSurface.withOpacity(0.08),
width: 1.5,
),
boxShadow: _isHovered
@@ -245,8 +245,8 @@ class _PlaylistCardState extends State<_PlaylistCard> {
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Colors.white.withOpacity(0.1),
Colors.white.withOpacity(0.05),
AppColors.onSurface.withOpacity(0.1),
AppColors.onSurface.withOpacity(0.05),
],
),
shape: BoxShape.circle,
@@ -263,16 +263,16 @@ class _PlaylistCardState extends State<_PlaylistCard> {
child: Icon(
Icons.playlist_play_rounded,
size: 32,
color: _isHovered ? Colors.white : Colors.white70,
color: _isHovered ? AppColors.onSurface : AppColors.onSurfaceVariant,
),
),
const SizedBox(height: 20),
Text(
widget.playlist.name,
style: GoogleFonts.syne(
style: GoogleFonts.fraunces(
fontSize: 22,
fontWeight: FontWeight.bold,
color: Colors.white,
color: AppColors.onSurface,
height: 1.2,
),
maxLines: 2,
@@ -281,9 +281,9 @@ class _PlaylistCardState extends State<_PlaylistCard> {
const SizedBox(height: 8),
Text(
Uri.tryParse(widget.playlist.dns)?.host ?? widget.playlist.dns,
style: GoogleFonts.instrumentSans(
style: GoogleFonts.karla(
fontSize: 13,
color: Colors.white38,
color: AppColors.onSurface38,
letterSpacing: 0.5,
),
maxLines: 1,
@@ -130,6 +130,7 @@ class _SeriesDetailScreenState extends ConsumerState<SeriesDetailScreen> {
width: 248,
height: 350,
fit: BoxFit.cover,
memCacheWidth: 500,
errorWidget: (_, __, ___) => Container(
width: 248,
height: 350,
@@ -143,7 +144,7 @@ class _SeriesDetailScreenState extends ConsumerState<SeriesDetailScreen> {
// Title
Text(
_seriesInfo!.name,
style: GoogleFonts.instrumentSans(
style: GoogleFonts.karla(
fontSize: 18,
fontWeight: FontWeight.bold,
color: AppColors.onSurface,
@@ -159,7 +160,7 @@ class _SeriesDetailScreenState extends ConsumerState<SeriesDetailScreen> {
const SizedBox(width: 4),
Text(
_formatRating(_seriesInfo!.rating!)!,
style: GoogleFonts.roboto(fontSize: 13, color: AppColors.onSurfaceVariant),
style: GoogleFonts.karla(fontSize: 13, color: AppColors.onSurfaceVariant),
),
],
),
@@ -169,7 +170,7 @@ class _SeriesDetailScreenState extends ConsumerState<SeriesDetailScreen> {
if (_seriesInfo!.plot != null && _seriesInfo!.plot!.isNotEmpty)
Text(
_seriesInfo!.plot!,
style: GoogleFonts.roboto(fontSize: 12, color: AppColors.onSurfaceVariant),
style: GoogleFonts.karla(fontSize: 12, color: AppColors.onSurfaceVariant),
maxLines: 5,
overflow: TextOverflow.ellipsis,
),
@@ -178,7 +179,7 @@ class _SeriesDetailScreenState extends ConsumerState<SeriesDetailScreen> {
// Season selector
Text(
'Seasons',
style: GoogleFonts.instrumentSans(
style: GoogleFonts.karla(
fontSize: 14,
fontWeight: FontWeight.w600,
color: AppColors.onSurface,
@@ -200,7 +201,7 @@ class _SeriesDetailScreenState extends ConsumerState<SeriesDetailScreen> {
},
selectedColor: AppColors.primaryContainer,
backgroundColor: AppColors.surfaceContainer,
labelStyle: GoogleFonts.instrumentSans(
labelStyle: GoogleFonts.karla(
color: isSelected ? AppColors.onPrimary : AppColors.onSurfaceVariant,
fontSize: 12,
),
@@ -224,7 +225,7 @@ class _SeriesDetailScreenState extends ConsumerState<SeriesDetailScreen> {
padding: const EdgeInsets.all(16),
child: Text(
'Season $_selectedSeason - ${currentEpisodes.length} Episodes',
style: GoogleFonts.instrumentSans(
style: GoogleFonts.karla(
fontSize: 16,
fontWeight: FontWeight.w600,
color: AppColors.onSurface,
@@ -236,7 +237,7 @@ class _SeriesDetailScreenState extends ConsumerState<SeriesDetailScreen> {
? Center(
child: Text(
'No episodes found',
style: GoogleFonts.roboto(color: AppColors.onSurfaceVariant),
style: GoogleFonts.karla(color: AppColors.onSurfaceVariant),
),
)
: ListView.builder(
@@ -323,7 +324,7 @@ class _SeriesDetailScreenState extends ConsumerState<SeriesDetailScreen> {
? const Icon(Icons.check, color: AppColors.onSurface, size: 20)
: Text(
'${episode.episodeNum}',
style: GoogleFonts.instrumentSans(
style: GoogleFonts.karla(
fontSize: 16,
fontWeight: FontWeight.bold,
color: AppColors.onSurface,
@@ -340,7 +341,7 @@ class _SeriesDetailScreenState extends ConsumerState<SeriesDetailScreen> {
children: [
Text(
episode.title,
style: GoogleFonts.roboto(
style: GoogleFonts.karla(
fontSize: 14,
fontWeight: FontWeight.w500,
color: isWatched ? AppColors.onSurfaceVariant : AppColors.onSurface,
@@ -351,7 +352,7 @@ class _SeriesDetailScreenState extends ConsumerState<SeriesDetailScreen> {
if (episode.durationSecs != null && episode.durationSecs! > 0)
Text(
_formatDuration(episode.durationSecs!),
style: GoogleFonts.roboto(
style: GoogleFonts.karla(
fontSize: 12,
color: AppColors.onSurfaceVariant,
),