chore(mobile): persist video controls visibility when swiping (#26986)

At current, the controls for videos are always hidden when opening an
asset from the timeline, and when swiping between assets. The latter is
actually quite annoying, so it would be better UX if video controls were
hidden when opening from the timeline like before, but visibility of the
controls was retained when swiping between assets.
This commit is contained in:
Thomas 2026-04-04 22:11:59 +01:00 committed by GitHub
parent 767caf9bfe
commit bcc29903de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -65,13 +65,15 @@ class AssetViewer extends ConsumerStatefulWidget {
static void setAsset(WidgetRef ref, BaseAsset asset) {
ref.read(assetViewerProvider.notifier).reset();
// Hide controls by default for videos
if (asset.isVideo) ref.read(assetViewerProvider.notifier).setControls(false);
_setAsset(ref, asset);
}
static void _setAsset(WidgetRef ref, BaseAsset asset) {
ref.read(assetViewerProvider.notifier).setAsset(asset);
// Hide controls by default for videos
if (asset.isVideo) ref.read(assetViewerProvider.notifier).setControls(false);
}
}