From 242a13ca30efa617b268cf52d0a49e9b86d31c0e Mon Sep 17 00:00:00 2001 From: gramps Date: Thu, 5 Nov 2026 09:15:30 -0800 Subject: [PATCH] fix(media): a played-out clip can play again; play button beside the Video File label MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported 2026-11-05: "when I click Loop, the video doesn't play in the preview pane". Two causes, both real: - `VideoClipPipe.StartAsync` bailed out once it had run once (`_run != null`), so a clip that reached EOF could never be started again — it held its last frame forever. - Loop is only consulted at end-of-file by a LIVE decoder, so flipping it on a finished clip did nothing at all. Now: the pipe reports running state and is restartable after a natural end; the manager marks a session finished (keeping its last frame) and exposes `IsRunning`/`RestartAsync`; the layer shows `IsMediaRunning`/`IsMediaFinished`; flipping Loop on a finished clip restarts it. UI: `▶ Play` sits to the right of the **Video File** label and is enabled only while Loop is off (creator ruling: with Loop on the clip already runs continuously, so there is nothing to start). The panel says "Clip finished — holding the last frame." so a frozen picture explains itself. Also: verify.sh no longer runs physical-input tests by default. That test moves the real cursor (SetCursorPos + mouse_event); running it mid-gate hijacks the machine someone is using, which is exactly how it felt. Opt in with PHYSICAL_TESTS=1 when the desktop is idle; the header documents the scoped-run command for working hours. Test: `MediaPlaybackRestartTests` (pipe restart, finished state, Play again, Loop-on-finished). 8 scoped tests green. FULL SUITE NOT RUN — the machine was in use; run scripts/verify.sh in a quiet window before the next milestone. --- Controls/LeftPanel.xaml | 13 +- Models/Source.cs | 24 +++- Services/MediaVideoSourceManager.cs | 56 ++++++++ Services/VideoClipPipe.cs | 18 ++- ViewModels/MainViewModel.Media.cs | 45 +++++- ViewModels/MainViewModel.cs | 6 + scripts/verify.sh | 8 +- ytLive.Tests/MediaPlaybackRestartTests.cs | 166 ++++++++++++++++++++++ 8 files changed, 327 insertions(+), 9 deletions(-) create mode 100644 ytLive.Tests/MediaPlaybackRestartTests.cs diff --git a/Controls/LeftPanel.xaml b/Controls/LeftPanel.xaml index 43da574..b821dae 100644 --- a/Controls/LeftPanel.xaml +++ b/Controls/LeftPanel.xaml @@ -729,7 +729,15 @@ - + +