Implementa pausa diretta con copertina slate e ripresa.
Metti in pausa ferma RTMP lato app mantenendo la camera aperta, MediaMTX manda offline.mp4 agli spettatori e Chiudi termina definitivamente. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -8,10 +8,12 @@ class LiveBadge extends StatelessWidget {
|
||||
super.key,
|
||||
required this.elapsed,
|
||||
this.compact = false,
|
||||
this.paused = false,
|
||||
});
|
||||
|
||||
final Duration elapsed;
|
||||
final bool compact;
|
||||
final bool paused;
|
||||
|
||||
String _format(Duration d) {
|
||||
final h = d.inHours;
|
||||
@@ -24,29 +26,34 @@ class LiveBadge extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final bg = paused ? const Color(0xFF555555) : AppTheme.primaryRed;
|
||||
final label = paused
|
||||
? (compact ? 'PAUSA ${_format(elapsed)}' : 'IN PAUSA ${_format(elapsed)}')
|
||||
: (compact ? 'LIVE ${_format(elapsed)}' : 'IN DIRETTA ${_format(elapsed)}');
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: compact ? 10 : 14,
|
||||
vertical: compact ? 4 : 6,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppTheme.primaryRed,
|
||||
color: bg,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
width: compact ? 6 : 8,
|
||||
height: compact ? 6 : 8,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.white,
|
||||
shape: BoxShape.circle,
|
||||
if (!paused)
|
||||
Container(
|
||||
width: compact ? 6 : 8,
|
||||
height: compact ? 6 : 8,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.white,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: compact ? 6 : 8),
|
||||
if (!paused) SizedBox(width: compact ? 6 : 8),
|
||||
Text(
|
||||
compact ? 'LIVE ${_format(elapsed)}' : 'IN DIRETTA ${_format(elapsed)}',
|
||||
label,
|
||||
style: theme.textTheme.labelLarge?.copyWith(
|
||||
color: Colors.white,
|
||||
fontSize: compact ? 11 : 13,
|
||||
|
||||
Reference in New Issue
Block a user