fix(mobile): reset video controls hide timer when showing controls ch… (#26985)

fix(mobile): reset video controls hide timer when showing controls changes

The hide timer currently only resets when the status of the video
changes, but does not account for when the controls change. This means
that two things happen:

 1. The hide timer does not reset when the controls become visible
    again, the controls will stay visible forever or until the playback
    status changes.
 2. The hide timer will fire too quickly, and will hide the controls
    much sooner than 5 seconds if the controls are hidden and then shown
    again before the hide timer fires.
This commit is contained in:
Thomas 2026-04-04 22:12:56 +01:00 committed by GitHub
parent bcc29903de
commit 1772f720bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -60,6 +60,9 @@ class VideoControls extends HookConsumerWidget {
}
});
ref.listen(assetViewerProvider.select((v) => v.showingControls), (prev, showing) {
if (showing && prev != showing) hideTimer.reset();
});
ref.listen(provider.select((v) => v.status), (_, __) => hideTimer.reset());
final notifier = ref.read(provider.notifier);