chore(mobile): persist video controls visibility when swiping

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 Way
2026-03-17 17:01:37 +00:00
parent 677cb660f5
commit eb4bd05391

View File

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