Repository navigation
Fix exercise video play icon staying visible during playback - #1359
Merged
rolandgeider merged 1 commit intoSep 7, 2026
Merged
Conversation
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).
Member
|
merged, thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When viewing an exercise video, tapping play starts playback (frames + audio advance) but the large central play-arrow overlay never disappears — it stays on top of the playing video, so you can't actually see the video.
Cause
In
lib/features/exercises/widgets/videos.dart,_ControlsOverlaydecides whether to show the play icon fromcontroller.value.isPlaying. But reading.valuedoes not subscribe to the controller's notifications.VideoPlayerControlleris aValueNotifier<VideoPlayerValue>:play()updates the value and notifies listeners, but nothing here listens, so the overlay is never rebuilt._ExerciseVideoWidgetStateonly callssetState()after initialization/error, not on play/pause. The siblingVideoPlayerupdating doesn't rebuild the overlay.Fix
Wrap
_ControlsOverlayin aValueListenableBuildertied to the controller so it rebuilds on every controller notification. TheAnimatedSwitcherthen receivesSizedBox.shrink()when playback starts and the icon animates away. This also keeps the playback-speed label current.Minimal, one-widget change; no behavior change beyond the overlay now reacting to play/pause state.
Notes
Reproduced on iOS. More visible on iOS since AVPlayer is stricter, but the missing-subscription bug is platform-independent.