forked from flutter/packages
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[camera] Change default Android implementation from
camera_android
…
…to `camera_android_camerax` (flutter#6629) Breaking change: Changes default Android implementation from `camera_android` to `camera_android_camerax` via a breaking change and updates relevant documentation. ~<ins>**Note:**</ins> Planning to land this after flutter#6608, as it is a semi-crucial fix.~ Done :)
- Loading branch information
Showing
10 changed files
with
101 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
# camera\_android | ||
|
||
The Android implementation of [`camera`][1]. | ||
|
||
*Note*: [`camera_android_camerax`][3] will become the default implementation of | ||
`camera` on Android by May 2024, so **we strongly encourage you to opt into it** | ||
by using [these instructions][4]. If any [limitations][5] of `camera_android_camerax` | ||
prevent you from using it or if you run into any problems, please report these | ||
issues under [`flutter/flutter`][5] with `[camerax]` in the title. | ||
An Android implementation of [`camera`][1] built with the [Camera2 library][4]. | ||
|
||
## Usage | ||
|
||
This package is [endorsed][2], which means you can simply use `camera` | ||
normally. This package will be automatically included in your app when you do, | ||
so you do not need to add it to your `pubspec.yaml`. | ||
As of `camera: ^0.11.0`, to use this plugin instead of [`camera_android_camerax`][3], | ||
run | ||
|
||
```sh | ||
$ flutter pub add camera_android | ||
``` | ||
|
||
However, if you `import` this package to use any of its APIs directly, you | ||
should add it to your `pubspec.yaml` as usual. | ||
## Limitation of testing video recording on emulators | ||
`MediaRecorder` does not work properly on emulators, as stated in [the documentation][5]. Specifically, | ||
when recording a video with sound enabled and trying to play it back, the duration won't be correct and | ||
you will only see the first frame. | ||
|
||
[1]: https://pub.dev/packages/camera | ||
[2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin | ||
[3]: https://pub.dev/packages/camera_android_camerax | ||
[4]: https://pub.dev/packages/camera_android_camerax#usage | ||
[5]: https://pub.dev/packages/camera_android_camerax#limitations | ||
[4]: https://developer.android.com/media/camera/camera2 | ||
[5]: https://developer.android.com/reference/android/media/MediaRecorder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters