Skip to content

Commit da1a58f

Browse files
committed
Update Readme
1 parent 5c5f14c commit da1a58f

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

README.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Ngx-Webcam [![npm version](https://badge.fury.io/js/ngx-webcam.svg)](https://badge.fury.io/js/ngx-webcam) [![Build Status](https://travis-ci.org/basst314/ngx-webcam.svg?branch=master)](https://travis-ci.org/basst314/ngx-webcam)
1+
# ngx-webcam [![npm version](https://badge.fury.io/js/ngx-webcam.svg)](https://badge.fury.io/js/ngx-webcam) [![Build Status](https://travis-ci.org/basst314/ngx-webcam.svg?branch=master)](https://travis-ci.org/basst314/ngx-webcam)
22

3-
A simple Angular 4+ Webcam-Component. Pure &amp; minimal, no Flash-Fallback. <a href="https://basst314.github.io/ngx-webcam/?" target="_blank">See the Demo!</a>
3+
A simple Angular 9+ webcam component. Pure &amp; minimal, no Flash-Fallback. <a href="https://basst314.github.io/ngx-webcam/?" target="_blank">See the Demo!</a>
44

5-
**Plug-and-play.** This library contains a single webcam-module which can be imported into nearly every Angular 4+ project.
5+
**Plug-and-play.** This library contains a single module which can be imported into every standard Angular 9+ project.
66

77
**Simple to use.** The one component gives you full control and lets you take snapshots via actions and event bindings.
88

@@ -14,24 +14,25 @@ Try out the <a href="https://basst314.github.io/ngx-webcam/?" target="_blank">Li
1414
## Features
1515
* Webcam live view
1616
* Photo capturing
17-
* Smartphone compatibility for modern OS's (OS must support WebRTC/UserMedia API)
17+
* Smartphone compatibility for modern OS's (OS must support [WebRTC/UserMedia API](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices))
1818
* Access to front- and back-camera, if multiple cameras exist
1919
* Portrait & Landscape mode on smartphones
20-
* Mirrored view for user-facing cameras, to enhance user experience (e.g. on smartphones)
20+
* Mirrored live-view for user-facing cameras - "selfie view" on phones
2121
* Capturing of lossless pixel image data for better post-processing.
2222

2323

2424
## Prerequisites
2525

2626
### Runtime Dependencies
27-
* Angular: `^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0`
28-
* RxJs: `^5.0.0 || ^6.0.0`
29-
* App must be served on a secure context (https or localhost)
27+
* Angular: `>=9.0.0`
28+
* Typescript: `>=3.7.0`
29+
* RxJs: `>=5.0.0`
30+
* **Important:** Your app must be served on a secure context using `https://` or on localhost, for modern browsers to permit WebRTC/UserMedia access.
3031

3132
### Client
32-
* [Current Browser](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Browser_compatibility) w/ HTML5 and WebRTC/UserMedia support (Chrome >53, Safari >11, Firefox >38, Edge)
33-
* Webcam :)
34-
* User permissions to access the webcam
33+
* [Current browser](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Browser_compatibility) w/ HTML5 and WebRTC/UserMedia support (Chrome >53, Safari >11, Firefox >38, Edge)
34+
* Webcam / camera
35+
* User permissions to access the camera
3536

3637
## Usage
3738
1) Install the library via standard npm command:
@@ -68,7 +69,7 @@ This section describes the basic inputs/outputs of the component. All inputs are
6869
* `width: number`: The maximal video width of the webcam live view.
6970
* `height: number`: The maximal video height of the webcam live view. The actual view will be placed within these boundaries, respecting the aspect ratio of the video stream.
7071
* `videoOptions: MediaTrackConstraints`: Defines constraints ([MediaTrackConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints)) to apply when requesting the video track.
71-
* `mirrorImage: string | WebcamMirrorProperties`: Flag to control image mirroring. If the attribute is missing or `null` and a webcam claims to be user-facing, the image will be mirrored (x-axis) to provide a better user experience. A string value of `"never"` will prevent mirroring, whereas a value of `"always"` will mirror every webcam stream, even if the webcam cannot be detected as user-facing. For future extensions, the `WebcamMirrorProperties` object can also be used to set these values.
72+
* `mirrorImage: string | WebcamMirrorProperties`: Flag to control image mirroring. If the attribute is missing or `null` and the camera claims to be user-facing, the image will be mirrored (x-axis) to provide a better user experience ("selfie view"). A string value of `"never"` will prevent mirroring, whereas a value of `"always"` will mirror every camera stream, even if the camera cannot be detected as user-facing. For future extensions, the `WebcamMirrorProperties` object can also be used to set these values.
7273
* `allowCameraSwitch: boolean`: Flag to enable/disable camera switch. If enabled, a switch icon will be displayed if multiple cameras are found.
7374
* `switchCamera: Observable<boolean|string>`: Can be used to cycle through available cameras (true=forward, false=backwards), or to switch to a specific device by deviceId (string).
7475
* `captureImageData: boolean = false`: Flag to enable/disable capturing of a lossless pixel ImageData object when a snapshot is taken. ImageData will be included in the emitted `WebcamImage` object.
@@ -82,11 +83,11 @@ This section describes the basic inputs/outputs of the component. All inputs are
8283
* `cameraSwitched: EventEmitter<string>`: Emits the active deviceId after the active video device has been switched.
8384

8485
## Good To Know
85-
### How to determine if the user denied camera access
86+
### How to determine if a user has denied camera access
8687
When camera initialization fails for some reason, the component emits a `WebcamInitError` via the `initError` EventEmitter. If provided by the browser, this object contains a field `mediaStreamError: MediaStreamError` which contains information about why UserMedia initialization failed. According to [Mozilla API docs](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia), this object contains a `name` attribute which gives insight about the reason.
8788
> If the user denies permission, or matching media is not available, then the promise is rejected with NotAllowedError or NotFoundError respectively.
8889
89-
In case a user denied permissions this can be determined like this:
90+
Determine if a user has denied permissions:
9091
```
9192
<webcam (initError)="handleInitError($event)"></webcam>
9293
```
@@ -105,7 +106,7 @@ Here you can find instructions on how to start developing this library.
105106
Run `npm run packagr` to build the library. The build artifacts will be stored in the `dist/` directory.
106107

107108
### Start
108-
Run `npm start` to build and run the surrounding webapp with the `WebcamModule`. Essential for live-developing.
109+
Run `npm start` to build and run the surrounding demo app with the `WebcamModule`. Essential for live-developing.
109110

110111
### Generate docs/
111112
Run `npm run docs` to generate the live-demo documentation pages in the `docs/` directory.

0 commit comments

Comments
 (0)