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

[camera_platform_interface] Add web-relevant docs #4358

Merged
Show file tree
Hide file tree
Changes from 2 commits
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
4 changes: 4 additions & 0 deletions packages/camera/camera_platform_interface/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,21 @@ abstract class CameraPlatform extends PlatformInterface {
/// [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,
}) {
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.');
}
Expand All @@ -91,7 +93,7 @@ abstract class CameraPlatform extends PlatformInterface {
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.');
}
Expand Down Expand Up @@ -153,6 +155,7 @@ abstract class CameraPlatform extends PlatformInterface {
}

/// 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.');
}
Expand Down Expand Up @@ -227,8 +230,8 @@ abstract class CameraPlatform extends PlatformInterface {

/// 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.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera_platform_interface/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repository: https://github.com/flutter/plugins/tree/master/packages/camera/camer
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'
Expand Down