diff --git a/Camera.MAUI/Platforms/Android/MauiCameraView.cs b/Camera.MAUI/Platforms/Android/MauiCameraView.cs index 402c2b3..9ebf62a 100644 --- a/Camera.MAUI/Platforms/Android/MauiCameraView.cs +++ b/Camera.MAUI/Platforms/Android/MauiCameraView.cs @@ -210,6 +210,8 @@ internal async Task StartRecordingAsync(string file, Microsoft.Mau var maxVideoSize = ChooseMaxVideoSize(map.GetOutputSizes(Class.FromType(typeof(ImageReader)))); if (Resolution.Width != 0 && Resolution.Height != 0) maxVideoSize = new((int)Resolution.Width, (int)Resolution.Height); + + videoSize = maxVideoSize; mediaRecorder.SetVideoSize(maxVideoSize.Width, maxVideoSize.Height); IWindowManager windowManager = context.GetSystemService(Context.WindowService).JavaCast(); @@ -337,6 +339,8 @@ internal async Task StartCameraAsync(Microsoft.Maui.Graphics.Size var maxVideoSize = ChooseMaxVideoSize(map.GetOutputSizes(Class.FromType(typeof(ImageReader)))); if (PhotosResolution.Width != 0 && PhotosResolution.Height != 0) maxVideoSize = new((int)PhotosResolution.Width, (int)PhotosResolution.Height); + + videoSize = maxVideoSize; imgReader = ImageReader.NewInstance(maxVideoSize.Width, maxVideoSize.Height, ImageFormatType.Jpeg, 1); backgroundThread = new HandlerThread("CameraBackground"); backgroundThread.Start();