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
Prev Previous commit
Next Next commit
Address comments from #6697
  • Loading branch information
camsim99 committed May 9, 2024
commit b5108cc1ef26e1be8dc54ec92ff9f3ed0ef903c4
3 changes: 2 additions & 1 deletion packages/camera/camera/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## 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`.
to `camera_android_camerax`, which has full feature parity with `camera_android` except for all
of the limitations listed in `README.md`. To continue using `camera_android`, use `camera <0.11.0`.

## 0.10.6

Expand Down
9 changes: 9 additions & 0 deletions packages/camera/camera/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ Change the minimum Android sdk version to 21 (or higher) in your `android/app/bu
minSdkVersion 21
```

It's important to note that the endorsed [`camera_android_camerax`][2] implementation of the camera plugin
built with CameraX has several limitations; please see this list of all of [the list of limitations][3]
for more details. If you wish to use the [`camera_android`][4] implementation of the camera plugin built
with Camera2 that lacks these limitations, please follow [these instructions][5].

### Web integration

For web integration details, see the
Expand Down Expand Up @@ -165,3 +170,7 @@ class _CameraAppState extends State<CameraApp> {
For a more elaborate usage example see [here](https://github.com/flutter/packages/tree/main/packages/camera/camera/example).

[1]: https://pub.dev/packages/camera_web#limitations-on-the-web-platform
[2]: https://pub.dev/packages/camera_android_camerax
[3]: https://pub.dev/packages/camera_android_camerax#limitations
[4]: https://pub.dev/packages/camera_android
[5]: https://pub.dev/packages/camera_android#usage
Original file line number Diff line number Diff line change
Expand Up @@ -196,26 +196,21 @@ void main() {

int startPause;
int timePaused = 0;
const int pauseIterations = 2;

await controller.startVideoRecording();
final int recordingStart = DateTime.now().millisecondsSinceEpoch;
sleep(const Duration(milliseconds: 500));

await controller.pauseVideoRecording();
startPause = DateTime.now().millisecondsSinceEpoch;
sleep(const Duration(milliseconds: 500));
await controller.resumeVideoRecording();
timePaused += DateTime.now().millisecondsSinceEpoch - startPause;

sleep(const Duration(milliseconds: 500));

await controller.pauseVideoRecording();
startPause = DateTime.now().millisecondsSinceEpoch;
sleep(const Duration(milliseconds: 500));
await controller.resumeVideoRecording();
timePaused += DateTime.now().millisecondsSinceEpoch - startPause;
for (int i = 0; i < pauseIterations; i++) {
await controller.pauseVideoRecording();
startPause = DateTime.now().millisecondsSinceEpoch;
sleep(const Duration(milliseconds: 500));
await controller.resumeVideoRecording();
timePaused += DateTime.now().millisecondsSinceEpoch - startPause;

sleep(const Duration(milliseconds: 500));
sleep(const Duration(milliseconds: 500));
}

final XFile file = await controller.stopVideoRecording();
final int recordingTime =
Expand Down