You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by br...@apache.org on 2013/03/18 16:24:45 UTC

[2/2] android commit: Implemented a conditional check to allow for the duration to be provided on the Android platform for SDK 8 and above.

Updated Branches:
  refs/heads/master 66b827e50 -> 1648f161d


Implemented a conditional check to allow for the duration to be provided on the Android platform for SDK 8 and above.


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/9fa6cea6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/9fa6cea6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/9fa6cea6

Branch: refs/heads/master
Commit: 9fa6cea69b33470ba2b1b014061b84394c293bef
Parents: 66b827e
Author: Richard Burton <mr...@gmail.com>
Authored: Thu Mar 14 12:15:02 2013 -0700
Committer: Braden Shepherdson <br...@gmail.com>
Committed: Mon Mar 18 11:23:21 2013 -0400

----------------------------------------------------------------------
 framework/src/org/apache/cordova/Capture.java |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/9fa6cea6/framework/src/org/apache/cordova/Capture.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/Capture.java b/framework/src/org/apache/cordova/Capture.java
index 1ed99d0..e6b94bc 100644
--- a/framework/src/org/apache/cordova/Capture.java
+++ b/framework/src/org/apache/cordova/Capture.java
@@ -23,6 +23,7 @@ import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.OutputStream;
 
+import android.os.Build;
 import org.apache.cordova.api.CallbackContext;
 import org.apache.cordova.api.CordovaPlugin;
 import org.apache.cordova.api.LOG;
@@ -216,9 +217,10 @@ public class Capture extends CordovaPlugin {
      */
     private void captureVideo(double duration) {
         Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
-        // Introduced in API 8
-        //intent.putExtra(android.provider.MediaStore.EXTRA_DURATION_LIMIT, duration);
 
+        if(Build.VERSION.SDK_INT > 8){
+            intent.putExtra(android.provider.MediaStore.EXTRA_DURATION_LIMIT, duration);
+        }
         this.cordova.startActivityForResult((CordovaPlugin) this, intent, CAPTURE_VIDEO);
     }