Skip to content

Commit e251630

Browse files
ditmanKyleFin
authored andcommitted
[camera_platform_interface] Add web-relevant docs (flutter#4358)
1 parent 47a060f commit e251630

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

packages/camera/camera_platform_interface/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.1.1
2+
3+
* Add web-relevant docs to platform interface code.
4+
15
## 2.1.0
26

37
* Introduces interface methods for pausing and resuming the camera preview.

packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart

+8-5
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,21 @@ abstract class CameraPlatform extends PlatformInterface {
6464
/// [imageFormatGroup] is used to specify the image formatting used.
6565
/// On Android this defaults to ImageFormat.YUV_420_888 and applies only to the imageStream.
6666
/// On iOS this defaults to kCVPixelFormatType_32BGRA.
67+
/// On Web this parameter is currently not supported.
6768
Future<void> initializeCamera(
6869
int cameraId, {
6970
ImageFormatGroup imageFormatGroup = ImageFormatGroup.unknown,
7071
}) {
7172
throw UnimplementedError('initializeCamera() is not implemented.');
7273
}
7374

74-
/// The camera has been initialized
75+
/// The camera has been initialized.
7576
Stream<CameraInitializedEvent> onCameraInitialized(int cameraId) {
7677
throw UnimplementedError('onCameraInitialized() is not implemented.');
7778
}
7879

79-
/// The camera's resolution has changed
80+
/// The camera's resolution has changed.
81+
/// On Web this returns an empty stream.
8082
Stream<CameraResolutionChangedEvent> onCameraResolutionChanged(int cameraId) {
8183
throw UnimplementedError('onResolutionChanged() is not implemented.');
8284
}
@@ -91,7 +93,7 @@ abstract class CameraPlatform extends PlatformInterface {
9193
throw UnimplementedError('onCameraError() is not implemented.');
9294
}
9395

94-
/// The camera finished recording a video
96+
/// The camera finished recording a video.
9597
Stream<VideoRecordedEvent> onVideoRecordedEvent(int cameraId) {
9698
throw UnimplementedError('onCameraTimeLimitReached() is not implemented.');
9799
}
@@ -153,6 +155,7 @@ abstract class CameraPlatform extends PlatformInterface {
153155
}
154156

155157
/// Sets the flash mode for the selected camera.
158+
/// On Web [FlashMode.auto] corresponds to [FlashMode.always].
156159
Future<void> setFlashMode(int cameraId, FlashMode mode) {
157160
throw UnimplementedError('setFlashMode() is not implemented.');
158161
}
@@ -227,8 +230,8 @@ abstract class CameraPlatform extends PlatformInterface {
227230

228231
/// Set the zoom level for the selected camera.
229232
///
230-
/// The supplied [zoom] value should be between 1.0 and the maximum supported
231-
/// zoom level returned by the `getMaxZoomLevel`. Throws a `CameraException`
233+
/// The supplied [zoom] value should be between the minimum and the maximum supported
234+
/// zoom level returned by `getMinZoomLevel` and `getMaxZoomLevel`. Throws a `CameraException`
232235
/// when an illegal zoom level is supplied.
233236
Future<void> setZoomLevel(int cameraId, double zoom) {
234237
throw UnimplementedError('setZoomLevel() is not implemented.');

packages/camera/camera_platform_interface/lib/src/types/resolution_preset.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
///
77
/// If a preset is not available on the camera being used a preset of lower quality will be selected automatically.
88
enum ResolutionPreset {
9-
/// 352x288 on iOS, 240p (320x240) on Android
9+
/// 352x288 on iOS, 240p (320x240) on Android and Web
1010
low,
1111

12-
/// 480p (640x480 on iOS, 720x480 on Android)
12+
/// 480p (640x480 on iOS, 720x480 on Android and Web)
1313
medium,
1414

1515
/// 720p (1280x720)
@@ -18,7 +18,7 @@ enum ResolutionPreset {
1818
/// 1080p (1920x1080)
1919
veryHigh,
2020

21-
/// 2160p (3840x2160)
21+
/// 2160p (3840x2160 on Android and iOS, 4096x2160 on Web)
2222
ultraHigh,
2323

2424
/// The highest resolution available.

packages/camera/camera_platform_interface/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ repository: https://github.com/flutter/plugins/tree/master/packages/camera/camer
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
55
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
66
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
7-
version: 2.1.0
7+
version: 2.1.1
88

99
environment:
1010
sdk: '>=2.12.0 <3.0.0'

0 commit comments

Comments
 (0)