From ac73568a2240bf8c4682c3cd35d0f7ba8b6fa1b5 Mon Sep 17 00:00:00 2001 From: Sebastian Schlote Date: Mon, 11 Jun 2018 00:36:04 -0700 Subject: [PATCH] Allow to switch between available cameras; Allow video options to be passed to webcam component; --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c1f548c..1ecc758 100644 --- a/README.md +++ b/README.md @@ -14,10 +14,9 @@ Try out the Li * Webcam live view * Photo capturing * Smartphone compatibility for modern OS's (OS must support WebRTC/UserMedia access) -* Access to front- and back-camera, if multiple cameras exist (feature in progress) +* Access to front- and back-camera, if multiple cameras exist * Portrait & Landscape mode on smartphones -More features coming soon. ## Prerequisites Runtime Dependencies: @@ -59,11 +58,17 @@ As simple as that. This section describes the basic Inputs/Outputs of the component. ### Inputs * `trigger: Observable`: An `Observable` to trigger image capturing. When it fires, an image will be captured and emitted (see Outputs). +* `width: number`: The maximal video width of the webcam live view +* `height: number`: The maximal video height of the webcam live view +* `videoOptions: MediaTrackConstraints`: Defines base constraints to apply when requesting video track from UserMedia +* `allowCameraSwitch: boolean`: Flag to enable/disable camera switch. If enabled, a switch icon will be displayed if multiple cameras were found +* `switchCamera: Observable`: Can be used to cycle through available cameras (true=forward, false=backwards), or to switch to a specific device by deviceId (string). ### Outputs * `imageCapture: EventEmitter`: Whenever an image is captured (e.g. triggered by `[trigger]`), the image is emitted via this `EventEmitter`. The image data is contained in the `WebcamImage` data structure. * `imageClick: EventEmitter`: An `EventEmitter` to signal clicks on the webcam area. * `initError: EventEmitter`: An `EventEmitter` to signal errors during the webcam initialization. +* `cameraSwitched: EventEmitter`: Emits the active deviceId after the active video device was switched ## Development Here you can find instructions on how to start developing this library.