[camera_platform_interface] Add web-relevant docs (#4358)
diff --git a/packages/camera/camera_platform_interface/CHANGELOG.md b/packages/camera/camera_platform_interface/CHANGELOG.md
index 6567d00..195e142 100644
--- a/packages/camera/camera_platform_interface/CHANGELOG.md
+++ b/packages/camera/camera_platform_interface/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 2.1.1
+
+* Add web-relevant docs to platform interface code.
+
## 2.1.0
* Introduces interface methods for pausing and resuming the camera preview.
diff --git a/packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart b/packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart
index 7a7bbf3..aafeef8 100644
--- a/packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart
+++ b/packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart
@@ -64,6 +64,7 @@
/// [imageFormatGroup] is used to specify the image formatting used.
/// On Android this defaults to ImageFormat.YUV_420_888 and applies only to the imageStream.
/// On iOS this defaults to kCVPixelFormatType_32BGRA.
+ /// On Web this parameter is currently not supported.
Future<void> initializeCamera(
int cameraId, {
ImageFormatGroup imageFormatGroup = ImageFormatGroup.unknown,
@@ -71,12 +72,13 @@
throw UnimplementedError('initializeCamera() is not implemented.');
}
- /// The camera has been initialized
+ /// The camera has been initialized.
Stream<CameraInitializedEvent> onCameraInitialized(int cameraId) {
throw UnimplementedError('onCameraInitialized() is not implemented.');
}
- /// The camera's resolution has changed
+ /// The camera's resolution has changed.
+ /// On Web this returns an empty stream.
Stream<CameraResolutionChangedEvent> onCameraResolutionChanged(int cameraId) {
throw UnimplementedError('onResolutionChanged() is not implemented.');
}
@@ -91,7 +93,7 @@
throw UnimplementedError('onCameraError() is not implemented.');
}
- /// The camera finished recording a video
+ /// The camera finished recording a video.
Stream<VideoRecordedEvent> onVideoRecordedEvent(int cameraId) {
throw UnimplementedError('onCameraTimeLimitReached() is not implemented.');
}
@@ -153,6 +155,7 @@
}
/// Sets the flash mode for the selected camera.
+ /// On Web [FlashMode.auto] corresponds to [FlashMode.always].
Future<void> setFlashMode(int cameraId, FlashMode mode) {
throw UnimplementedError('setFlashMode() is not implemented.');
}
@@ -227,8 +230,8 @@
/// Set the zoom level for the selected camera.
///
- /// The supplied [zoom] value should be between 1.0 and the maximum supported
- /// zoom level returned by the `getMaxZoomLevel`. Throws a `CameraException`
+ /// The supplied [zoom] value should be between the minimum and the maximum supported
+ /// zoom level returned by `getMinZoomLevel` and `getMaxZoomLevel`. Throws a `CameraException`
/// when an illegal zoom level is supplied.
Future<void> setZoomLevel(int cameraId, double zoom) {
throw UnimplementedError('setZoomLevel() is not implemented.');
diff --git a/packages/camera/camera_platform_interface/lib/src/types/resolution_preset.dart b/packages/camera/camera_platform_interface/lib/src/types/resolution_preset.dart
index 1724f6c..fcb6b83 100644
--- a/packages/camera/camera_platform_interface/lib/src/types/resolution_preset.dart
+++ b/packages/camera/camera_platform_interface/lib/src/types/resolution_preset.dart
@@ -6,10 +6,10 @@
///
/// If a preset is not available on the camera being used a preset of lower quality will be selected automatically.
enum ResolutionPreset {
- /// 352x288 on iOS, 240p (320x240) on Android
+ /// 352x288 on iOS, 240p (320x240) on Android and Web
low,
- /// 480p (640x480 on iOS, 720x480 on Android)
+ /// 480p (640x480 on iOS, 720x480 on Android and Web)
medium,
/// 720p (1280x720)
@@ -18,7 +18,7 @@
/// 1080p (1920x1080)
veryHigh,
- /// 2160p (3840x2160)
+ /// 2160p (3840x2160 on Android and iOS, 4096x2160 on Web)
ultraHigh,
/// The highest resolution available.
diff --git a/packages/camera/camera_platform_interface/pubspec.yaml b/packages/camera/camera_platform_interface/pubspec.yaml
index d691afd..41c6a97 100644
--- a/packages/camera/camera_platform_interface/pubspec.yaml
+++ b/packages/camera/camera_platform_interface/pubspec.yaml
@@ -4,7 +4,7 @@
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
-version: 2.1.0
+version: 2.1.1
environment:
sdk: '>=2.12.0 <3.0.0'