You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by do...@apache.org on 2013/06/25 21:00:04 UTC
git commit: [CB-3998] video duration is an int
Updated Branches:
refs/heads/master cf675e631 -> fb38b3863
[CB-3998] video duration is an int
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/commit/fb38b386
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/fb38b386
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/fb38b386
Branch: refs/heads/master
Commit: fb38b38639430edc8ae0df2593f73c87d5a92072
Parents: cf675e6
Author: Don Coleman <do...@apache.org>
Authored: Tue Jun 25 14:59:35 2013 -0400
Committer: Don Coleman <do...@apache.org>
Committed: Tue Jun 25 14:59:35 2013 -0400
----------------------------------------------------------------------
src/android/Capture.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/fb38b386/src/android/Capture.java
----------------------------------------------------------------------
diff --git a/src/android/Capture.java b/src/android/Capture.java
index c8ebf0b..12ef21d 100644
--- a/src/android/Capture.java
+++ b/src/android/Capture.java
@@ -64,7 +64,7 @@ public class Capture extends CordovaPlugin {
private CallbackContext callbackContext; // The callback context from which we were invoked.
private long limit; // the number of pics/vids/clips to take
- private double duration; // optional duration parameter for video recording
+ private int duration; // optional max duration of video recording in seconds
private JSONArray results; // The array of results to be returned to the user
private int numPics; // Number of pictures before capture activity
@@ -82,13 +82,13 @@ public class Capture extends CordovaPlugin {
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
this.callbackContext = callbackContext;
this.limit = 1;
- this.duration = 0.0f;
+ this.duration = 0;
this.results = new JSONArray();
JSONObject options = args.optJSONObject(0);
if (options != null) {
limit = options.optLong("limit", 1);
- duration = options.optDouble("duration", 0.0f);
+ duration = options.optInt("duration", 0);
}
if (action.equals("getFormatData")) {
@@ -217,10 +217,10 @@ public class Capture extends CordovaPlugin {
/**
* Sets up an intent to capture video. Result handled by onActivityResult()
*/
- private void captureVideo(double duration) {
+ private void captureVideo(int duration) {
Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
- if(Build.VERSION.SDK_INT > 8){
+ if(Build.VERSION.SDK_INT > 7){
intent.putExtra("android.intent.extra.durationLimit", duration);
}
this.cordova.startActivityForResult((CordovaPlugin) this, intent, CAPTURE_VIDEO);