feat(9): real broadcast close-out — transition(complete) in StopStream after RTMP EOF
The specced 'End stream -> transition(complete)' call never existed: stopping relied entirely on enableAutoStop (viewers sat on a frozen stream-offline for ~a minute, VOD finalized late). Found during the 2026-09-01 recording-verification pass while the creator asked 'if there's proper close-out info yt needs, we'll provide it?' EndBroadcastAsync POSTs liveBroadcasts/transition?broadcastStatus=complete&id=..&part=status, called after the pump stops (RTMP EOF first) and only when a live session had a broadcast — record-only stops stay offline. invalidTransition/410 (autoStop already ended it) is logged and returned as an error string, never thrown: a stop must never fail over close-out. ONE integration test (URL shape + never-throws on 403). ai.md/TASKS.md design lines marked SHIPPED with the map-lie note. Ref: https://developers.google.com/youtube/v3/live/docs/liveBroadcasts/transition
This commit is contained in:
@@ -238,6 +238,19 @@ public partial class MainViewModel : ViewModelBase
|
||||
// monitoring); only the live/report pipe, the pump, and the session stop here.
|
||||
_audioMixer.StopLive();
|
||||
await _framePump.StopAsync();
|
||||
|
||||
// Proper close-out (TASK 9 decision 6, built 2026-09-01): transition(complete)
|
||||
// AFTER the RTMP push is closed so no frames post-date the end — YouTube then
|
||||
// finalizes the VOD immediately instead of leaving viewers on a frozen
|
||||
// "stream offline" until enableAutoStop fires (~1 min). Log-only failure:
|
||||
// the backstop still ends the broadcast; a stop never fails over cosmetics.
|
||||
if (wasLive && _currentBroadcastId != null)
|
||||
{
|
||||
var closeOutError = await _youtubeStream.EndBroadcastAsync(_currentBroadcastId);
|
||||
if (closeOutError != null)
|
||||
AppLog.Write($"End close-out: {closeOutError} — enableAutoStop will finish the broadcast");
|
||||
}
|
||||
|
||||
_currentBroadcastId = null;
|
||||
OnPropertyChanged(nameof(CurrentBroadcastId));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user