Repository navigation
[video_player_android] Incorrect orientation when previewing captured videos #154696
Copy link
Copy link
Closed
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listfound in release: 3.24Found to occur in 3.24Found to occur in 3.24found in release: 3.25Found to occur in 3.25Found to occur in 3.25has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: video_playerThe Video Player pluginThe Video Player pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-androidOwned by Android platform teamOwned by Android platform teamtriaged-androidTriaged by Android platform teamTriaged by Android platform team
Description
Workaround
- Pin
video_player_androidto 2.7.1. - Upgrade to
video_player_androidto 2.8.4.
Steps to reproduce
With the official example
- Run the example of
camera - Select a camera and record for a few seconds in portrait up.
- See the preview video being orientated incorrectly.
With other Flutter packages
Run the example of package:wechat_camera_picker.
Expected results
The video preview should have a correct rotation.
Actual results
The video preview shows an incorrect rotation. This is likely affected by flutter/packages#6456, and we also have similar problems with camera_android_camerax: #149177, and camera_android: #150549.
Code sample
https://github.com/flutter/packages/tree/main/packages/camera/camera/example
Screenshots or Video
Screenshots / Video demonstration
petal_20240906_092951.mp4
Logs
N/A
Flutter Doctor output
Doctor output
[✓] Flutter (Channel master, 3.25.0-1.0.pre.270, on Microsoft Windows [Version 10.0.22631.4037], locale en-US)
• Flutter version 3.25.0-1.0.pre.270 on channel master at X:\SDK\flutter-master
• Upstream repository https://github.com/flutter/flutter
• Framework revision a7cd788d80 (16 hours ago), 2024-09-05 05:57:40 -0400
• Engine revision 34b61eb53b
• Dart version 3.6.0 (build 3.6.0-216.0.dev)
• DevTools version 2.39.0
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn
[✓] Windows Version (Installed version of Windows is version 10 or higher)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
• Android SDK at X:\Android\SDK
• Platform android-35, build-tools 35.0.0
• ANDROID_HOME = X:\Android\SDK
• ANDROID_SDK_ROOT = X:\Android\SDK
• Java binary at: X:\IDEs\AndroidStudio\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)
• All Android licenses accepted.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listfound in release: 3.24Found to occur in 3.24Found to occur in 3.24found in release: 3.25Found to occur in 3.25Found to occur in 3.25has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: video_playerThe Video Player pluginThe Video Player pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-androidOwned by Android platform teamOwned by Android platform teamtriaged-androidTriaged by Android platform teamTriaged by Android platform team
Activity
AlexV525 commentedon Sep 6, 2024
We've also received reports from:
huycozy commentedon Sep 6, 2024
huycozy commentedon Sep 6, 2024
Re-checking this on Flutter stable
3.24.2and master3.25.0-1.0.pre.283, I can reproduce the issue using camera_android_camerax example.The current plugin versions:
camera_android_camerax: 0.6.8+3andvideo_player_android: ^2.7.343 remaining items
LUK3D commentedon Apr 6, 2025
flutter-triage-bot commentedon Apr 9, 2025
This issue is assigned to @camsim99 but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!
2tick commentedon Apr 11, 2025
i am also facing same problem....if you want temporary solution, You can use this easy_video_editor package to get video aspect ratio and use it with Aspect ratio widget
suesitran commentedon Apr 24, 2025
Facing the same problem, but it only happens to Pixel Fold.
Tested on Pixel Fold, Sony Xperia and Samsung Galaxy.
I also tried to set video_player_android to 2.6.0 and 2.4.2, none helped.
camsim99 commentedon May 7, 2025
Please let us know if you still see this issue in version 2.8.3. I've been wondering if #157198 impacts this issue, which that version fixes.
AlexV525 commentedon May 17, 2025
@camsim99 The orientation is correct, but the aspect ratio is still wrong.
camsim99 commentedon May 19, 2025
Landing flutter/packages#9199 -- hopefully related to this issue as well.
AlexV525 commentedon May 21, 2025
I confirm that flutter/packages#9199 resolves the issue, and it's included in
video_player_android2.8.4. Thanks for the fix!github-actions commentedon Jun 5, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.