mirror of
https://github.com/flutter/packages.git
synced 2025-06-27 21:28:33 +08:00
[camera_android]: Fixes crash when record video on Android versions lower than 12 (#4635)
The the solution of the issue flutter/flutter#109769 in the #7073 causes a crashes when the Android SDK version is lower than 31, due to EncoderProfiles not being found on these devices. This issue was solved putting the EncoderProfiles declaration after the check for SDK version. based on https://github.com/flutter/plugins/pull/7073 by @camsim99. Fixes https://github.com/flutter/flutter/issues/109769 in Android lower than 12.
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
## NEXT
|
||||
## 0.10.8+7
|
||||
|
||||
* Fixes video record crash on Android versions lower than 12.
|
||||
* Updates minimum supported SDK version to Flutter 3.7/Dart 2.19.
|
||||
|
||||
## 0.10.8+6
|
||||
|
@ -256,9 +256,8 @@ class Camera
|
||||
|
||||
// TODO(camsim99): Revert changes that allow legacy code to be used when recordingProfile is null
|
||||
// once this has largely been fixed on the Android side. https://github.com/flutter/flutter/issues/119668
|
||||
EncoderProfiles recordingProfile = getRecordingProfile();
|
||||
if (SdkCapabilityChecker.supportsEncoderProfiles() && recordingProfile != null) {
|
||||
mediaRecorderBuilder = new MediaRecorderBuilder(recordingProfile, outputFilePath);
|
||||
if (SdkCapabilityChecker.supportsEncoderProfiles() && getRecordingProfile() != null) {
|
||||
mediaRecorderBuilder = new MediaRecorderBuilder(getRecordingProfile(), outputFilePath);
|
||||
} else {
|
||||
mediaRecorderBuilder = new MediaRecorderBuilder(getRecordingProfileLegacy(), outputFilePath);
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ description: Android implementation of the camera plugin.
|
||||
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android
|
||||
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
|
||||
|
||||
version: 0.10.8+6
|
||||
version: 0.10.8+7
|
||||
|
||||
environment:
|
||||
sdk: ">=2.19.0 <4.0.0"
|
||||
|
Reference in New Issue
Block a user