Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera direction support for both iOS and Android. #154

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ description: Capture audio, video, and images.
# under the License.
-->

|AppVeyor|Travis CI|
|:-:|:-:|
|[![Build status](https://ci.appveyor.com/api/projects/status/github/apache/cordova-plugin-media-capture?branch=master)](https://ci.appveyor.com/project/ApacheSoftwareFoundation/cordova-plugin-media-capture)|[![Build Status](https://travis-ci.org/apache/cordova-plugin-media-capture.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-media-capture)|
| AppVeyor | Travis CI |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------: |
| [![Build status](https://ci.appveyor.com/api/projects/status/github/apache/cordova-plugin-media-capture?branch=master)](https://ci.appveyor.com/project/ApacheSoftwareFoundation/cordova-plugin-media-capture) | [![Build Status](https://travis-ci.org/apache/cordova-plugin-media-capture.svg?branch=master)](https://travis-ci.org/apache/cordova-plugin-media-capture) |

# cordova-plugin-media-capture

Expand Down Expand Up @@ -332,10 +332,12 @@ capturing a video clip, the `CaptureErrorCB` callback executes with a

- __limit__: The maximum number of images the user can capture in a single capture operation. The value must be greater than or equal to 1 (defaults to 1).

- __cameraDirection__: Pick camera direction. Accepted values are 1 (for front camera) and 0 (for back camera). Or you can use the constants (window.MediaCapture.CAMERA_FRONT or window.MediaCapture.CAMERA_BACK)

### Example

// limit capture operation to 3 images
var options = { limit: 3 };
var options = { limit: 3, cameraDirection: window.MediaCapture.CAMERA_FRONT };

navigator.device.capture.captureImage(captureSuccess, captureError, options);

Expand All @@ -354,10 +356,12 @@ capturing a video clip, the `CaptureErrorCB` callback executes with a

- __duration__: The maximum duration of a video clip, in seconds.

- __cameraDirection__: Pick camera direction. Accepted values are 1 (for front camera) and 0 (for back camera). Or you can use the constants (window.MediaCapture.CAMERA_FRONT or window.MediaCapture.CAMERA_BACK)

### Example

// limit capture operation to 3 video clips
var options = { limit: 3 };
var options = { limit: 3, cameraDirection: window.MediaCapture.CAMERA_FRONT };

navigator.device.capture.captureVideo(captureSuccess, captureError, options);

Expand Down
4 changes: 4 additions & 0 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ xmlns:android="http://schemas.android.com/apk/res/android"
</engines>

<dependency id="cordova-plugin-file" version="^6.0.0" />

<js-module src="www/CameraConstants.js" name="MediaCapture">
<clobbers target="MediaCapture" />
</js-module>

<js-module src="www/CaptureAudioOptions.js" name="CaptureAudioOptions">
<clobbers target="CaptureAudioOptions" />
Expand Down
Loading