From 68c52a82154b671eac4a4d91474ecfebb80f685a Mon Sep 17 00:00:00 2001 From: otsmr Date: Tue, 20 May 2025 17:04:12 +0200 Subject: [PATCH] fix #170 --- lib/src/views/camera/camera_preview_view.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/src/views/camera/camera_preview_view.dart b/lib/src/views/camera/camera_preview_view.dart index bf99a90..2133694 100644 --- a/lib/src/views/camera/camera_preview_view.dart +++ b/lib/src/views/camera/camera_preview_view.dart @@ -365,6 +365,13 @@ class _CameraPreviewViewState extends State { sharePreviewIsShown = true; }); XFile? videoPath = await controller?.stopVideoRecording(); + if (videoPath != null) { + if (Platform.isAndroid) { + // see https://github.com/flutter/flutter/issues/148335 + await File(videoPath.path).rename("${videoPath.path}.mp4"); + videoPath = XFile("${videoPath.path}.mp4"); + } + } await controller?.pausePreview(); if (await pushMediaEditor(null, videoPath)) { return;