Skip to content

Commit 80e77b8

Browse files
committed
Merge pull request onemightyroar#3 from onemightyroar/develop
Documented parameters
2 parents f8165d7 + 0e1ffd8 commit 80e77b8

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,25 @@ An Angular directive for easily taking pictures from your webcam.
1414
```html
1515
<ng-camera
1616
type="photo"
17-
enabled="cameraActive"
17+
enabled="true"
1818
width="640"
1919
height="480"
2020
countdown="3"
2121
ng-model="media"
22-
overlay-src="photoFrame"
23-
capture="publish()"
24-
capture-message="SMILE!"></ng-camera>
22+
overlay-src="http://example.com/photo-frame.png"
23+
capture="callback(media)"
24+
capture-message="Go!"></ng-camera>
2525
```
2626

27-
The captured photo will save a Base64 version of itself to the ng-model's definition. Overlay an optional picture frame via `overlay-src` to have it stitched onto the final image.
28-
29-
More extensive documentation to follow.
27+
### Options
28+
* `type` _string_ Type of media the capture (photo, video, gif). Photo is currently the only one supported
29+
* `enabled` _boolean_ Enables or disables the stream by turning on/off webcam access
30+
* `width` _integer_ Width in pixels for the video feed
31+
* `height` _integer_ Height in pixels for the video feed
32+
* `countdown` _integer_ Countdown time in seconds. Zero is replaced with `capture-message` text.
33+
* `ng-model` _object_ Scope variable to data-bind resulting Base64-encoded image
34+
* `overlay-src` _string_ Optional. Reference to image frame to overlay onto media. Automatically resizes to fit canvas.
35+
* `capture` _function_ Callback for "Take Picture" button for use in parent scope. Passes Base64-encoded output as parameter
36+
* `capture-message` _string_ Optional. Text to show during countdown instead of "0"
3037

3138
_Built by [Zach Dunn](https://github.com/zachdunn) from work on the [Robin Platform](http://getrobin.com)_

0 commit comments

Comments
 (0)