From aa2828ab338d7aadd0d6e9224e53970ff0a2e12d Mon Sep 17 00:00:00 2001 From: John Stef Date: Fri, 25 Jul 2025 00:38:08 +0300 Subject: [PATCH] fix(mobile): hide video thumbnail when video is ready (#19328) --- mobile/lib/pages/common/native_video_viewer.page.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mobile/lib/pages/common/native_video_viewer.page.dart b/mobile/lib/pages/common/native_video_viewer.page.dart index 8afa6ab4e3..5c1dd8fc66 100644 --- a/mobile/lib/pages/common/native_video_viewer.page.dart +++ b/mobile/lib/pages/common/native_video_viewer.page.dart @@ -63,6 +63,8 @@ class NativeVideoViewerPage extends HookConsumerWidget { final isCasting = ref.watch(castProvider.select((c) => c.isCasting)); + final isVideoReady = useState(false); + Future createSource() async { if (!context.mounted) { return null; @@ -197,6 +199,8 @@ class NativeVideoViewerPage extends HookConsumerWidget { VideoPlaybackValue.fromNativeController(videoController); ref.read(videoPlaybackValueProvider.notifier).value = videoPlayback; + isVideoReady.value = true; + try { await videoController.play(); await videoController.setVolume(0.9); @@ -393,7 +397,8 @@ class NativeVideoViewerPage extends HookConsumerWidget { children: [ // This remains under the video to avoid flickering // 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) Visibility.maintain( key: ValueKey(asset),