1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-29 15:11:58 +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,28 +422,31 @@ class NativeVideoViewerPage extends HookConsumerWidget {
[],
);
final video = aspectRatio.value != null
? Center(
key: ValueKey(asset),
child: AspectRatio(
key: ValueKey(asset),
aspectRatio: aspectRatio.value!,
child: isCurrent
? NativeVideoPlayerView(
key: ValueKey(asset),
onViewReady: initController,
)
: 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 (aspectRatio.value != null)
Visibility.maintain(
visible: asset.isVideo || showMotionVideo,
child: Center(
key: ValueKey(asset),
child: AspectRatio(
key: ValueKey(asset),
aspectRatio: aspectRatio.value!,
child: isCurrent
? NativeVideoPlayerView(
key: ValueKey(asset),
onViewReady: initController,
)
: null,
),
),
),
if (video != null)
asset.isVideo
? video
: Visibility.maintain(visible: showMotionVideo, child: video),
if (showControls) const Center(child: CustomVideoPlayerControls()),
],
);