-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[video_player_android] Fix incorrect dimensions swap #9199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…270 rotation Since flutter#6535 `VideoSize` is used to get width and height instead of getting them from the video `Format`. My testing concluded that `VideoSize` dimension values are post rotation and do not need to be swapped when there is a 90 or 270 degree rotation present.
Just an FYI that I'm working on #9107, which will change the API >= 29 check (that gates the usage of |
Just tested out a Pixel Tablet running API 34 (handles crop and rotation automatically) and it appears to work on the main branch and in this PR (with the videos provided in the example app--not sure if this makes a difference). Will do more testing on physical devices. |
return RotatedBox( | ||
quarterTurns: rotation ~/ 90, | ||
child: child, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just to mirror the changes that were done in #8685 to the _VideoPlayerWithRotation
of the main video_player
package.
I can revert that change if it doesn't make sense in this PR...But the example is broken otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok this definitely needs to be fixed then. Can you mention this change in the CHANGELOG?
Thanks for bringing that up. I also thought about that, but I don't see any reason for conflict. |
Appreciate it! They will definitely reflect if this PR messed anything up with videos that do not need a rotation, but I don't think any of the example videos require rotation to begin with. Maybe we can add a new video that would meet that requirement? |
I just tested on API 33, on a Samsung A71, and the issue is resolved with your fix! Thank you so much! |
Thank you! Just to make sure, you tried with a video that requires rotation? |
Did some more testing (with your apple video) and updated the table in the PR description! Also tested on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM! You'll need to fix the CHANGELOG merge conflict though. Thanks for taking on this issue!
return RotatedBox( | ||
quarterTurns: rotation ~/ 90, | ||
child: child, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok this definitely needs to be fixed then. Can you mention this change in the CHANGELOG?
Will do the changes.
Very nice. That's a good amount of testing, cheers! |
Alright, I've resolved the conflicts and added the example app fix to the CHANGELOG. Thanks for your attentive support on this issue! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
flutter/packages@af0b9a9...6eebe72 2025-05-27 [email protected] [flutter_lints] Bump lints dependency to 6.0.0 and bump package to 6.0.0 (flutter/packages#9108) 2025-05-26 [email protected] Roll Flutter from 60050a0 to 4372bfb (6 revisions) (flutter/packages#9322) 2025-05-26 [email protected] [video_player_android] Add note about Android platform views known issue (flutter/packages#9312) 2025-05-24 [email protected] Roll Flutter from 85564cb to 60050a0 (17 revisions) (flutter/packages#9318) 2025-05-23 [email protected] [camera_android_camerax] Implement `enableAudio` for video recording (flutter/packages#9264) 2025-05-23 [email protected] [video_player_android] isBuffering flag always return true after calling seekTo method - fixed (flutter/packages#9198) 2025-05-23 [email protected] [camera,video_player] replace onSurfaceDestroyed with onSurfaceCleanup (flutter/packages#9316) 2025-05-23 [email protected] [camera,video_player] Update Android to 3.29 minimum (flutter/packages#9317) 2025-05-23 [email protected] Roll Flutter from 33cdd8e to 85564cb (39 revisions) (flutter/packages#9315) 2025-05-23 [email protected] Update repo for 3.32 stable (flutter/packages#9311) 2025-05-23 [email protected] [camera_avfoundation] Correct pigeon configuration output paths (flutter/packages#9313) 2025-05-23 [email protected] [process] Remove from the repository (flutter/packages#9310) 2025-05-22 [email protected] Ensure Example Packages Work on Android API 36 (flutter/packages#9241) 2025-05-22 [email protected] Roll Flutter (stable) from c236373 to be698c4 (1274 revisions) (flutter/packages#9300) 2025-05-22 [email protected] Remove CODEOWNER for generated iOS files (flutter/packages#9272) 2025-05-22 [email protected] [google_maps_flutter] Removes unnecessary parentheses (flutter/packages#9273) 2025-05-21 [email protected] Rebalance Android plugin CODEOWNERS (flutter/packages#9298) 2025-05-21 [email protected] Roll Flutter from 9a78af5 to 33cdd8e (60 revisions) (flutter/packages#9305) 2025-05-21 [email protected] [ci] Update repository for 3.29 release (flutter/packages#9270) 2025-05-21 [email protected] Ignore .cxx/ directories (flutter/packages#9268) 2025-05-21 [email protected] [video_player] Skip some integration tests on web (flutter/packages#9302) 2025-05-21 [email protected] [webview_flutter] Adds support to respond to recoverable SSL certificate errors (flutter/packages#9150) 2025-05-19 [email protected] [camera_android_camerax] Swap out `BroadcastReceiver` for `OrientationEventListener` (flutter/packages#9261) 2025-05-19 [email protected] [video_player_android] Fix incorrect dimensions swap (flutter/packages#9199) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Fixes flutter/flutter#166097 *List which issues are fixed by this PR. You must list at least one issue.* ## Manual Testing Overview | API | Device | Video requires rotation | Works w/o fix| Works w/ fix | Ref | |---|---|---|---|---|---| | 35 | Emulator | yes | no | yes | flutter#9199 (comment) by @marvin-kolja | | 34 | Pixel Tablet | no | no | yes | flutter#9199 (comment) by @camsim99 | | 34 | Pixel Tablet | yes | no | yes | @camsim99 | | 33 | Samsung A71 | ? | ? | yes | flutter#9199 (comment) by @PaulineMoovency | | 32 | Pixel 3A | yes | no | yes | @camsim99 | | 27 | Samsung Galaxy J7 | yes | yes | yes | @camsim99 | ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
Fixes flutter/flutter#166097 *List which issues are fixed by this PR. You must list at least one issue.* ## Manual Testing Overview | API | Device | Video requires rotation | Works w/o fix| Works w/ fix | Ref | |---|---|---|---|---|---| | 35 | Emulator | yes | no | yes | flutter#9199 (comment) by @marvin-kolja | | 34 | Pixel Tablet | no | no | yes | flutter#9199 (comment) by @camsim99 | | 34 | Pixel Tablet | yes | no | yes | @camsim99 | | 33 | Samsung A71 | ? | ? | yes | flutter#9199 (comment) by @PaulineMoovency | | 32 | Pixel 3A | yes | no | yes | @camsim99 | | 27 | Samsung Galaxy J7 | yes | yes | yes | @camsim99 | ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
Fixes flutter/flutter#166097
List which issues are fixed by this PR. You must list at least one issue.
Manual Testing Overview
Pre-Review Checklist
[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3