From 96a5aa06bacd70a830c0eb49d5540c4dc4afd198 Mon Sep 17 00:00:00 2001 From: Roscoe Rubin-Rottenberg Date: Sat, 3 Jan 2026 02:33:57 -0500 Subject: [PATCH] fix: correct aspect ratio of vertical videos --- .../ui/video_editor_grounded_page.dart | 10 +++++++++- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/src/core/pro_video_editor/ui/video_editor_grounded_page.dart b/lib/src/core/pro_video_editor/ui/video_editor_grounded_page.dart index fd5f3ee9..069eef9e 100644 --- a/lib/src/core/pro_video_editor/ui/video_editor_grounded_page.dart +++ b/lib/src/core/pro_video_editor/ui/video_editor_grounded_page.dart @@ -213,12 +213,20 @@ class _VideoEditorGroundedPageState extends State { ]); if (!mounted) return; + // Adjust resolution based on rotation metadata + final rotation = _videoMetadata.rotation; + final convertedRotation = rotation % 360; + final is90DegRotated = convertedRotation == 90 || convertedRotation == 270; + final adjustedResolution = is90DegRotated + ? Size(_videoMetadata.resolution.height, _videoMetadata.resolution.width) + : _videoMetadata.resolution; + _proVideoController = ProVideoController( videoPlayer: VideoPlayerWidget( controller: _videoController, isLoadingListenable: _updateClipsNotifier, ), - initialResolution: _videoMetadata.resolution, + initialResolution: adjustedResolution, videoDuration: _videoMetadata.duration, fileSize: _videoMetadata.fileSize, thumbnails: _thumbnails, diff --git a/pubspec.lock b/pubspec.lock index 9e400062..e002857f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1241,10 +1241,10 @@ packages: dependency: "direct main" description: name: pro_image_editor - sha256: "58a8c1c17a4e14cd605a0ecc16a080af42c9ae613698eebec7653020cf19c178" + sha256: ed0357dea68412a08555c7c70da3efe7bec82e79e22f3aec4068c7fe18d49df1 url: "https://pub.dev" source: hosted - version: "12.0.0-beta.4" + version: "12.0.0-beta.5" pro_video_editor: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 2d5bc838..be1f1136 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -57,7 +57,7 @@ dependencies: assets: path: assets posthog_flutter: ^5.6.0 - pro_image_editor: ^12.0.0-beta.4 + pro_image_editor: ^12.0.0-beta.5 google_fonts: ^6.3.2 flutter_colorpicker: ^1.1.0 -- 2.54.0