mirror of
https://github.com/immich-app/immich.git
synced 2025-07-31 15:08:44 -04:00
fix(mobile): hide video thumbnail when video is ready (#19328)
This commit is contained in:
parent
a36840d7cc
commit
aa2828ab33
@ -63,6 +63,8 @@ class NativeVideoViewerPage extends HookConsumerWidget {
|
|||||||
|
|
||||||
final isCasting = ref.watch(castProvider.select((c) => c.isCasting));
|
final isCasting = ref.watch(castProvider.select((c) => c.isCasting));
|
||||||
|
|
||||||
|
final isVideoReady = useState(false);
|
||||||
|
|
||||||
Future<VideoSource?> createSource() async {
|
Future<VideoSource?> createSource() async {
|
||||||
if (!context.mounted) {
|
if (!context.mounted) {
|
||||||
return null;
|
return null;
|
||||||
@ -197,6 +199,8 @@ class NativeVideoViewerPage extends HookConsumerWidget {
|
|||||||
VideoPlaybackValue.fromNativeController(videoController);
|
VideoPlaybackValue.fromNativeController(videoController);
|
||||||
ref.read(videoPlaybackValueProvider.notifier).value = videoPlayback;
|
ref.read(videoPlaybackValueProvider.notifier).value = videoPlayback;
|
||||||
|
|
||||||
|
isVideoReady.value = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await videoController.play();
|
await videoController.play();
|
||||||
await videoController.setVolume(0.9);
|
await videoController.setVolume(0.9);
|
||||||
@ -393,7 +397,8 @@ class NativeVideoViewerPage extends HookConsumerWidget {
|
|||||||
children: [
|
children: [
|
||||||
// This remains under the video to avoid flickering
|
// This remains under the video to avoid flickering
|
||||||
// For motion videos, this is the image portion of the asset
|
// For motion videos, this is the image portion of the asset
|
||||||
Center(key: ValueKey(asset.id), child: image),
|
if (!isVideoReady.value || asset.isMotionPhoto)
|
||||||
|
Center(key: ValueKey(asset.id), child: image),
|
||||||
if (aspectRatio.value != null && !isCasting)
|
if (aspectRatio.value != null && !isCasting)
|
||||||
Visibility.maintain(
|
Visibility.maintain(
|
||||||
key: ValueKey(asset),
|
key: ValueKey(asset),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user