You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/camera/camera_web/README.md
+38-17Lines changed: 38 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,10 @@ The web implementation of [`camera`][camera].
6
6
7
7
## Usage
8
8
9
-
This package is [endorsed](https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin), which means you can simply use `camera` normally. This package will be automatically included in your app when you do.
9
+
### Depend on the package
10
+
11
+
This package is not an [endorsed implementation](https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin)
12
+
of the google_maps_flutter plugin yet, so you'll need to [add it explicitly](https://pub.dev/packages/camera_web/install).
10
13
11
14
## Example
12
15
@@ -16,41 +19,59 @@ Find the example in the [`camera` package](https://pub.dev/packages/camera#examp
16
19
17
20
### Camera devices
18
21
19
-
The camera devices are accessed with [Stream Web API](https://developer.mozilla.org/en-US/docs/Web/API/Media_Streams_API) with the following [browser support](https://caniuse.com/stream):
22
+
The camera devices are accessed with [Stream Web API](https://developer.mozilla.org/en-US/docs/Web/API/Media_Streams_API)
23
+
with the following [browser support](https://caniuse.com/stream):
20
24
21
25

22
26
23
-
Accessing camera devices requires a [secure browsing context](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts). This means that you might need to serve your web application over HTTPS. For insecure contexts `CameraPlatform.availableCameras` might throw a `CameraException` with the `permissionDenied` error code.
27
+
Accessing camera devices requires a [secure browsing context](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).
28
+
Broadly speaking, this means that you need to serve your web application over HTTPS
29
+
(or `localhost` for local development). For insecure contexts
30
+
`CameraPlatform.availableCameras` might throw a `CameraException` with the
31
+
`permissionDenied` error code.
24
32
25
33
### Device orientation
26
34
27
-
The device orientation implementation is backed by [`Screen Orientation Web API`](https://www.w3.org/TR/screen-orientation/) with the following [browser support](https://caniuse.com/screen-orientation):
35
+
The device orientation implementation is backed by [`Screen Orientation Web API`](https://www.w3.org/TR/screen-orientation/)
36
+
with the following [browser support](https://caniuse.com/screen-orientation):
28
37
29
38

30
39
31
40
For the browsers that do not support the device orientation:
41
+
32
42
-`CameraPlatform.onDeviceOrientationChanged` returns an empty stream.
33
-
-`CameraPlatform.lockCaptureOrientation` and `CameraPlatform.unlockCaptureOrientation` throw a `PlatformException` with the `orientationNotSupported` error code.
43
+
-`CameraPlatform.lockCaptureOrientation` and `CameraPlatform.unlockCaptureOrientation`
44
+
throw a `PlatformException` with the `orientationNotSupported` error code.
34
45
35
46
### Flash mode and zoom level
36
47
37
-
The flash mode and zoom level implementation is backed by [Image Capture Web API](https://w3c.github.io/mediacapture-image/) with the following [browser support](https://caniuse.com/mdn-api_imagecapture) (as of 12 August 2021):
48
+
The flash mode and zoom level implementation is backed by [Image Capture Web API](https://w3c.github.io/mediacapture-image/)
49
+
with the following [browser support](https://caniuse.com/mdn-api_imagecapture):
38
50
39
-

51
+

40
52
41
53
For the browsers that do not support the flash mode:
42
-
-`CameraPlatform.setFlashMode` throws a `PlatformException` with the `torchModeNotSupported` error code.
54
+
55
+
-`CameraPlatform.setFlashMode` throws a `PlatformException` with the
56
+
`torchModeNotSupported` error code.
43
57
44
58
For the browsers that do not support the zoom level:
45
-
-`CameraPlatform.getMaxZoomLevel`, `CameraPlatform.getMinZoomLevel` and `CameraPlatform.setZoomLevel` throw a `PlatformException` with the `zoomLevelNotSupported` error code.
59
+
60
+
-`CameraPlatform.getMaxZoomLevel`, `CameraPlatform.getMinZoomLevel` and
61
+
`CameraPlatform.setZoomLevel` throw a `PlatformException` with the
62
+
`zoomLevelNotSupported` error code.
46
63
47
64
### Taking a picture
48
65
49
-
The image capturing implementation is backed by [`URL.createObjectUrl` Web API](https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL) with the following [browser support](https://caniuse.com/bloburls):
66
+
The image capturing implementation is backed by [`URL.createObjectUrl` Web API](https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL)
67
+
with the following [browser support](https://caniuse.com/bloburls):
50
68
51
69

52
70
53
-
The web platform does not support `dart:io`. Attempts to display a captured image using `Image.file` will throw an error. The capture image contains a network-accessible URL pointing to a location within the browser and should be displayed using `Image.network` or `Image.memory` after loading the image bytes to memory.
71
+
The web platform does not support `dart:io`. Attempts to display a captured image
72
+
using `Image.file` will throw an error. The capture image contains a network-accessible
73
+
URL pointing to a location within the browser (blob) and can be displayed using
74
+
`Image.network` or `Image.memory` after loading the image bytes to memory.
54
75
55
76
See the example below:
56
77
@@ -65,13 +86,13 @@ if (kIsWeb) {
65
86
## Missing implementation
66
87
67
88
The web implementation of [`camera`][camera] is missing the following features:
68
-
- Video recording
89
+
90
+
- Video recording ([in progress](https://github.com/flutter/plugins/pull/4210))
0 commit comments