Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 084ea88

Browse files
author
Adam Harwood
committed
Update camera_web to latest camera_platform_interface
This is to avoid a version dependency conflict. The streaming itself will fail if the user attempts to enable it, given that streaming is not supported on web.
1 parent 95fbcb9 commit 084ea88

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

packages/camera/camera/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies:
2424
camera_android: ^0.11.0
2525
camera_avfoundation: ^0.10.0
2626
camera_platform_interface: ^2.3.0
27-
camera_web: ^0.3.0
27+
camera_web: ^0.3.1
2828
flutter:
2929
sdk: flutter
3030
flutter_plugin_android_lifecycle: ^2.0.2

packages/camera/camera_web/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
* Fixes avoid_redundant_argument_values lint warnings and minor typos.
44
* Ignores unnecessary import warnings in preparation for [upcoming Flutter changes](https://github.com/flutter/flutter/pull/106316).
55

6+
## 0.3.1
7+
8+
* Update to latest camera platform interface, and fail if user attempts to use streaming with recording (since streaming is currently unsupported on web).
9+
610
## 0.3.0
711

812
* **BREAKING CHANGE**: Renames error code `cameraPermission` to `CameraAccessDenied` to be consistent with other platforms.

packages/camera/camera_web/lib/src/camera_web.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,14 @@ class CameraPlugin extends CameraPlatform {
449449
}
450450

451451
@override
452-
Future<void> startVideoRecording(int cameraId, {Duration? maxVideoDuration}) {
452+
Future<void> startVideoRecording(int cameraId,
453+
{Duration? maxVideoDuration,
454+
Function(CameraImageData image)? streamCallback,
455+
CameraImageStreamOptions? streamOptions}) {
456+
if (streamCallback != null || streamOptions != null) {
457+
throw UnimplementedError('Streaming is not currently supported on web');
458+
}
459+
453460
try {
454461
final Camera camera = getCamera(cameraId);
455462

packages/camera/camera_web/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: camera_web
22
description: A Flutter plugin for getting information about and controlling the camera on Web.
33
repository: https://github.com/flutter/plugins/tree/main/packages/camera/camera_web
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
5-
version: 0.3.0
5+
version: 0.3.1
66

77
environment:
88
sdk: ">=2.12.0 <3.0.0"
@@ -17,7 +17,7 @@ flutter:
1717
fileName: camera_web.dart
1818

1919
dependencies:
20-
camera_platform_interface: ^2.1.0
20+
camera_platform_interface: ^2.3.0
2121
flutter:
2222
sdk: flutter
2323
flutter_web_plugins:

0 commit comments

Comments
 (0)