feat(ui): show YouTube-confirmed live state in top bar

Normal ON-AIR stays red until YouTube reports lifeCycleStatus=live, then turns green; TEST stays gold and stop restores the idle color.

Status-color reference: https://www.carbondesignsystem.com/building-blocks/core/patterns/status-indicators
This commit is contained in:
2026-11-04 11:19:40 -08:00
parent f921c0174b
commit 4b7e798757
5 changed files with 77 additions and 33 deletions
+18
View File
@@ -24,6 +24,7 @@ public partial class MainViewModel : ViewModelBase
/// <summary>Latches once the broadcast reaches live so the per-poll broadcast
/// diagnostic stops logging (2026-10-04). Reset at broadcast creation.</summary>
private bool _broadcastSeenLive;
private bool _youtubeBroadcastLive;
private string? _reusableStreamUrl;
private ReusableStream? _reusableStream;
private string? _healthIssueBanner;
@@ -63,6 +64,7 @@ public partial class MainViewModel : ViewModelBase
{
if (SetProperty(ref _streamStatus, value))
{
_youtubeBroadcastLive = false;
OnPropertyChanged(nameof(IsOffline));
OnPropertyChanged(nameof(IsLive));
OnPropertyChanged(nameof(IsEditMode));
@@ -373,6 +375,22 @@ public partial class MainViewModel : ViewModelBase
set => SetProperty(ref _topBarBackground, value);
}
internal void ApplyBroadcastLifecycleStatus(string? lifeCycleStatus)
{
if (!IsLive) return;
if (!string.Equals(lifeCycleStatus, "live", StringComparison.OrdinalIgnoreCase))
{
if (!_broadcastSeenLive)
_healthPollTimer.Interval = TimeSpan.FromSeconds(2);
return;
}
_broadcastSeenLive = true;
_youtubeBroadcastLive = true;
_healthPollTimer.Interval = TimeSpan.FromSeconds(30);
UpdateLiveVisuals();
}
public string PreviewGlowBrush
{
get => _previewGlowBrush;