Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Make base changes
  • Loading branch information
camsim99 committed Apr 30, 2024
commit 1cf757b3acc0835acfef73aa47766fcc81212f0c
4 changes: 3 additions & 1 deletion packages/camera/camera/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## NEXT
## 0.11.0

* **Breaking Change** Changes the Android implementation of the camera plugin from `camera_android`
to `camera_android_camerax`. To continue using `camera_android`, use `camera <0.11.0`.
* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
* Updates support matrix in README to indicate that iOS 11 is no longer supported.
* Clients on versions of Flutter that still support iOS 11 can continue to use this
Expand Down
2 changes: 0 additions & 2 deletions packages/camera/camera/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ Change the minimum Android sdk version to 21 (or higher) in your `android/app/bu
minSdkVersion 21
```

It's important to note that the `MediaRecorder` class is not working properly on emulators, as stated in the documentation: https://developer.android.com/reference/android/media/MediaRecorder. 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.

### Web integration

For web integration details, see the
Expand Down
6 changes: 3 additions & 3 deletions packages/camera/camera/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A Flutter plugin for controlling the camera. Supports previewing
Dart.
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
version: 0.10.5+9
version: 0.11.0

environment:
sdk: ^3.1.0
Expand All @@ -14,14 +14,14 @@ flutter:
plugin:
platforms:
android:
default_package: camera_android
default_package: camera_android_camerax
ios:
default_package: camera_avfoundation
web:
default_package: camera_web

dependencies:
camera_android: ^0.10.7
camera_android_camerax: ^0.6.4
camera_avfoundation: ^0.9.13
camera_platform_interface: ^2.5.0
camera_web: ^0.3.1
Expand Down
30 changes: 16 additions & 14 deletions packages/camera/camera_android/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
# 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
```

If using `camera: <0.11.0` and wish to use this plugin instead of [`camera_android_camerax`][3],
you can simply use `camera` normally because it is [endorsed][2]. This package will automatically
be included in your app when you do so, so you do not need to add it to your `pubspec.yaml`.

However, if you `import` this package with a version lower than `0.11.0`, to use any of its APIs directly, you should add it to your `pubspec.yaml` as usual.

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
It's important to note that the `MediaRecorder` class is not working properly on emulators, as stated in the documentation: https://developer.android.com/reference/android/media/MediaRecorder. 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
35 changes: 17 additions & 18 deletions packages/camera/camera_android_camerax/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
# camera\_android\_camerax

An Android implementation of [`camera`][1] that uses the [CameraX library][2].
The Android implementation of [`camera`][1] built with the [CameraX library][2].

*Note*: This implementation will become the default implementation of `camera`
on Android by May 2024, so **we strongly encourage you to opt into it**
by using [the instructions](#usage) below. If any of [the limitations](#limitations)
prevent you from using `camera_android_camerax` or if you run into any problems,
please report these issues under [`flutter/flutter`][5] with `[camerax]` in
the title.
*Note*: If any of [the limitations](#limitations) prevent you from using
using `camera_android_camerax` or if you run into any problems, please report
report these issues under [`flutter/flutter`][5] with `[camerax]` in the title.
You may also opt back into the [`camera_android`][6] implementation if you need.

## Usage

To use this plugin instead of [`camera_android`][4], run
As of `camera: ^0.11.0`, this package is [endorsed][3], which means you can
simply use `camera` normally. This package will be automatically be included
in your app when you do, so you do not need to add it to your `pubspec.yaml`.

However, if you `import` this package to use any of its APIs directly, you
should add it to your `pubspec.yaml` as usual.

If using `camera: <0.11.0` and wish to use this plugin instead of [`camera_android`][4],
run

```sh
$ flutter pub add camera_android_camerax
Expand All @@ -24,7 +30,7 @@ from your project's root directory.
### 240p resolution configuration for video recording

240p resolution configuration for video recording is unsupported by CameraX,
and thus, the plugin will fall back to 480p if configured with a
and thus, the plugin will fall back to target 480p if configured with a
`ResolutionPreset`.

### Setting maximum duration and stream options for video capture
Expand All @@ -42,14 +48,7 @@ For more information on contributing to this plugin, see [`CONTRIBUTING.md`](CON

[1]: https://pub.dev/packages/camera
[2]: https://developer.android.com/training/camerax
[3]: https://docs.flutter.dev/packages-and-plugins/developing-packages#non-endorsed-federated-plugin
[3]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin
[4]: https://pub.dev/packages/camera_android
[5]: https://github.com/flutter/flutter/issues/new/choose
[120462]: https://github.com/flutter/flutter/issues/120462
[125915]: https://github.com/flutter/flutter/issues/125915
[120715]: https://github.com/flutter/flutter/issues/120715
[120468]: https://github.com/flutter/flutter/issues/120468
[120467]: https://github.com/flutter/flutter/issues/120467
[125371]: https://github.com/flutter/flutter/issues/125371
[126477]: https://github.com/flutter/flutter/issues/126477
[127896]: https://github.com/flutter/flutter/issues/127896
[6]: https://pub.dev/packages/camera_android#usage