commit | 5e03bb1da411c99d80727f46e1821c4fdc6ea12c | [log] [tgz] |
---|---|---|
author | Camille Simon <43054281+camsim99@users.noreply.github.com> | Mon Oct 21 16:42:13 2024 -0700 |
committer | GitHub <noreply@github.com> | Mon Oct 21 23:42:13 2024 +0000 |
tree | c5f8da42bc36826b69186b8626eaf4cf40c4daf0 | |
parent | aad3fd00f2fb1563783d53783897265a2ba0af5b [diff] |
[video_player_android] Correct rotation of videos recorded by the camera (#7846) Hopefully ð¤ corrects the calculation used to determine the rotation correction of the video being played. These are the different cases this addresses: 1. **Strictly below Android API 22:** Kept this calculation the same as before because I was not able to test it. For context, it uses an unapplied rotation degrees reported by the video's size to correct the rotation. Note that this is always 0 after Android API 22+ (see [its docs](https://github.com/google/ExoPlayer/blob/dd430f7053a1a3958deea3ead6a0565150c06bfc/library/common/src/main/java/com/google/android/exoplayer2/video/VideoSize.java#L65)) 2. **Above Android API 22, strictly below Android API 29:** The `SurfaceTexture` Impeller backend is used. From my testing, I see the preview is correctly rotated and sized without any further intervention, so the correction is set 0. 3. **Android API 29+:** The `ImageReader` Impelled backend is used and a preview correction was noticed by the community (see https://github.com/flutter/flutter/issues/154696). To fix this, we now use the rotation correction reported by the video's format. We also now use this rotation to make the fix for a swapped = width and height when the correction is 90 or 270 degrees (indicating that the video is landscape) as the logic did before but instead with the unapplied rotation degrees (see case 1 for context). Tested this on Android APIs 28, 30, 32, and 35. A fix attempt for https://github.com/flutter/flutter/issues/154696.
This repo is a companion repo to the main flutter repo. It contains the source code for Flutter's first-party packages (i.e., packages developed by the core Flutter team). Check the packages
directory to see all packages.
These packages are also available on pub.
Please file any issues, bugs, or feature requests in the main flutter repo. Issues pertaining to this repository are labeled “package”.
If you wish to contribute a new package to the Flutter ecosystem, please see the documentation for developing packages. You can store your package source code in any GitHub repository (the present repo is only intended for packages developed by the core Flutter team). Once your package is ready you can publish to the pub repository.
If you wish to contribute a change to any of the existing packages in this repo, please review our contribution guide, and send a pull request.
These are the packages hosted in this repository: