1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-01 08:31:59 +00:00

use visibility for motion videos

This commit is contained in:
mertalev 2024-11-16 20:35:11 -05:00
parent b0a2a6ac13
commit 6c8f7b7e6d
No known key found for this signature in database
GPG key ID: CA85EF6600C9E8AD

View file

@ -422,15 +422,8 @@ class NativeVideoViewerPage extends HookConsumerWidget {
[],
);
return Stack(
children: [
// This remains under the video to avoid flickering
// For motion videos, this is the image portion of the asset
image,
if (aspectRatio.value != null)
Visibility.maintain(
visible: asset.isVideo || showMotionVideo,
child: Center(
final video = aspectRatio.value != null
? Center(
key: ValueKey(asset),
child: AspectRatio(
key: ValueKey(asset),
@ -442,8 +435,18 @@ class NativeVideoViewerPage extends HookConsumerWidget {
)
: null,
),
),
),
)
: null;
return Stack(
children: [
// This remains under the video to avoid flickering
// For motion videos, this is the image portion of the asset
image,
if (video != null)
asset.isVideo
? video
: Visibility.maintain(visible: showMotionVideo, child: video),
if (showControls) const Center(child: CustomVideoPlayerControls()),
],
);