From 83e2505ab195503e5e03a4337f18bf1cb249c18a Mon Sep 17 00:00:00 2001 From: Ian Anderson Date: Mon, 7 Sep 2026 13:26:54 -0400 Subject: [PATCH] Fix exercise video play icon staying visible during playback The controls overlay reads controller.value.isPlaying to decide whether to show the central play icon, but reading .value does not subscribe to the controller's notifications. VideoPlayerController is a ValueNotifier, so after play() is called the overlay is never rebuilt and the play icon stays on top of the playing video. Wrap _ControlsOverlay in a ValueListenableBuilder tied to the controller so it rebuilds on play/pause (and keeps the playback-speed label current). --- lib/features/exercises/widgets/videos.dart | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/features/exercises/widgets/videos.dart b/lib/features/exercises/widgets/videos.dart index 62d229ff9..0ff4579e7 100644 --- a/lib/features/exercises/widgets/videos.dart +++ b/lib/features/exercises/widgets/videos.dart @@ -103,7 +103,15 @@ class _ExerciseVideoWidgetState extends ConsumerState { alignment: Alignment.bottomCenter, children: [ VideoPlayer(controller), - _ControlsOverlay(controller: controller), + // Rebuild the overlay whenever the controller notifies (it is a + // ValueNotifier). Reading controller.value.isPlaying does not + // subscribe to changes, so without this the play icon never + // disappears once playback starts. + ValueListenableBuilder( + valueListenable: controller, + builder: (context, value, child) => + _ControlsOverlay(controller: controller), + ), VideoProgressIndicator(controller, allowScrubbing: true), ], ),