Skip to content

Fix exercise video play icon staying visible during playback - #1359

Merged
rolandgeider merged 1 commit into
wger-project:masterfrom
ATECHPCS:fix/exercise-video-play-overlay
Sep 7, 2026
Merged

rolandgeider merged 1 commit into
wger-project:masterfrom
ATECHPCS:fix/exercise-video-play-overlay

Conversation

@ATECHPCS

@ATECHPCS ATECHPCS commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

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, _ControlsOverlay decides whether to show the play icon from controller.value.isPlaying. But reading .value does not subscribe to the controller's notifications. VideoPlayerController is a ValueNotifier<VideoPlayerValue>: play() updates the value and notifies listeners, but nothing here listens, so the overlay is never rebuilt. _ExerciseVideoWidgetState only calls setState() after initialization/error, not on play/pause. The sibling VideoPlayer updating doesn't rebuild the overlay.

Fix

Wrap _ControlsOverlay in a ValueListenableBuilder tied to the controller so it rebuilds on every controller notification. The AnimatedSwitcher then receives SizedBox.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.

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).
@rolandgeider
rolandgeider merged commit a25fc31 into wger-project:master Sep 7, 2026
17 checks passed
@rolandgeider

Copy link
Copy Markdown
Member

merged, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants