Stabilizza live YouTube/RTMP e fix crash rotazione mobile.

Pipeline YouTube con relay, overlay e publisher sync lato backend; fix GL pauseGlDuringRotation su Android per evitare crash in rotazione durante lo streaming Flutter.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-06 15:30:55 +02:00
parent 1058c644bd
commit 854738b46d
65 changed files with 2606 additions and 579 deletions

View File

@@ -5,6 +5,7 @@ import 'package:intl/intl.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../app/theme.dart';
import '../../core/config.dart';
import '../../providers/auth_provider.dart';
import '../../shared/api_client.dart';
import '../../shared/models/match.dart';
@@ -64,7 +65,60 @@ class MatchesScreen extends ConsumerWidget {
loading: () => const Center(
child: CircularProgressIndicator(color: AppTheme.primaryRed),
),
error: (e, _) => Center(child: Text('Errore squadre: $e')),
error: (e, stack) {
final msg = e.toString();
final unauthorized = msg.contains('401');
final timeout = msg.contains('timeout') || msg.contains('Timeout');
final offline = timeout ||
msg.contains('SocketException') ||
msg.contains('Failed host lookup');
String title = 'Errore nel caricamento squadre';
String hint = 'Controlla WiFi o dati mobili e riprova.';
if (unauthorized) {
title = 'Sessione scaduta';
hint = 'Accedi di nuovo con email e password.';
} else if (offline) {
title = 'Server non raggiungibile';
hint = timeout
? 'La connessione è troppo lenta o assente. Verifica la rete (serve almeno qualche Mbps).'
: 'Impossibile contattare ${AppConfig.apiBaseUrl}. Riprova tra poco.';
}
return Center(
child: Padding(
padding: const EdgeInsets.all(24),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
title,
style: theme.textTheme.titleMedium,
textAlign: TextAlign.center,
),
const SizedBox(height: 8),
Text(
hint,
style: theme.textTheme.bodySmall,
textAlign: TextAlign.center,
),
const SizedBox(height: 16),
if (unauthorized)
FilledButton(
onPressed: () {
ref.read(authProvider.notifier).logout();
context.go('/login');
},
child: const Text('VAI AL LOGIN'),
)
else
TextButton(
onPressed: () => ref.invalidate(teamsProvider),
child: const Text('RIPROVA'),
),
],
),
),
);
},
data: (teams) {
if (teams.isEmpty) {
return NoTeamOnboarding(theme: theme);