|
@@ -23,12 +23,16 @@ uppy.use(Webcam, {
|
|
|
|
|
|
This plugin is published as the `@uppy/webcam` package.
|
|
|
|
|
|
+Install from NPM:
|
|
|
+
|
|
|
```shell
|
|
|
npm install @uppy/webcam
|
|
|
```
|
|
|
|
|
|
## Options
|
|
|
|
|
|
+The Webcam plugin has the following configurable options:
|
|
|
+
|
|
|
```js
|
|
|
uppy.use(Webcam, {
|
|
|
onBeforeSnapshot: () => Promise.resolve(),
|
|
@@ -47,15 +51,15 @@ uppy.use(Webcam, {
|
|
|
|
|
|
### `id: 'Webcam'`
|
|
|
|
|
|
-A unique identifier for this plugin. Defaults to `'Webcam'`.
|
|
|
+A unique identifier for this plugin. It defaults to `'Webcam'`.
|
|
|
|
|
|
### `target: null`
|
|
|
|
|
|
-DOM element, CSS selector, or plugin to mount Webcam into.
|
|
|
+DOM element, CSS selector, or plugin to mount the webcam into.
|
|
|
|
|
|
### `countdown: false`
|
|
|
|
|
|
-When taking a picture: the amount of seconds to wait before actually taking a snapshot. If `false` or 0, the timeout is disabled entirely. This also shows a `Smile!` message with the [Informer](/docs/informer) before the picture is taken.
|
|
|
+When taking a picture: the amount of seconds to wait before actually taking a snapshot. If set to `false` or 0, the timeout is disabled entirely. This also shows a `Smile!` message through the [Informer](/docs/informer) before the picture is taken.
|
|
|
|
|
|
### `onBeforeSnapshot: () => Promise.resolve()`
|
|
|
|
|
@@ -74,11 +78,11 @@ By default, all modes are allowed, and the Webcam plugin will show controls for
|
|
|
|
|
|
### `mirror: true`
|
|
|
|
|
|
-Whether to mirror preview image from the camera. This option is useful when taking a selfie with a front camera: when you wave your right hand, you will see your hand on the right on the preview screen, like in the mirror. But when you actually take a picture, it will not be mirrored. This is how smartphone selfie cameras behave.
|
|
|
+Configures whether or not to mirror preview image from the camera. This option is useful when taking a selfie with a front camera: when you wave your right hand, you will see your hand on the right on the preview screen, like in the mirror. But when you actually take a picture, it will not be mirrored. This is how smartphone selfie cameras behave.
|
|
|
|
|
|
### `facingMode: 'user'`
|
|
|
|
|
|
-Devices sometimes have multiple cameras, front and back, for example. There’s a browser API to set which camera will be used, [facingMode](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints/facingMode):
|
|
|
+Devices sometimes have multiple cameras, front and back, for example. There is a browser API to set which camera will be used, [facingMode](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints/facingMode):
|
|
|
|
|
|
- `user`: The video source is facing toward the user; this includes, for example, the front-facing camera on a smartphone.
|
|
|
- `environment`: The video source is facing away from the user, thereby viewing their environment. This is the back camera on a smartphone.
|