Skip to content

Commit

Permalink
Add new options to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
arturi committed Feb 9, 2018
1 parent f1bc38c commit 3a30f53
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/plugins/Webcam/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ module.exports = class Webcam extends Plugin {
onBeforeSnapshot: () => Promise.resolve(),
countdown: false,
locale: defaultLocale,
mirror: true,
facingMode: 'user',
modes: [
'video-audio',
'video-only',
'audio-only',
'picture'
]
],
mirror: true,
facingMode: 'user'
}

// merge default options with the ones set by user
Expand Down
19 changes: 18 additions & 1 deletion website/src/docs/webcam.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ title: "Webcam"
permalink: docs/webcam/
---

The Webcam plugin lets you take photos and record videos with a built-in camera on desktop and mobile devices.

[Try it live](/examples/dashboard/) - The Informer is included in the Dashboard by default.
[Try live!](/examples/dashboard/)

## Options

Expand All @@ -20,6 +21,8 @@ uppy.use(Webcam, {
'audio-only',
'picture'
],
mirror: true,
facingMode: 'user',
locale: {
strings: {
smile: 'Smile!'
Expand Down Expand Up @@ -52,6 +55,20 @@ The types of recording modes to allow.

By default, all modes are allowed, and the Webcam plugin will show controls for recording video as well as taking pictures.

### `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.

### `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):

- `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.
- `left`: The video source is facing toward the user but to their left, such as a camera aimed toward the user but over their left shoulder.
- `right`: The video source is facing toward the user but to their right, such as a camera aimed toward the user but over their right shoulder.


### `locale: {}`

There is only one localizable string: `strings.smile`. It's shown before a picture is taken, when the `countdown` option is set to true.

0 comments on commit 3a30f53

Please sign in to comment.