From 9fa6cea69b33470ba2b1b014061b84394c293bef Mon Sep 17 00:00:00 2001 From: Richard Burton Date: Thu, 14 Mar 2013 12:15:02 -0700 Subject: [PATCH] Implemented a conditional check to allow for the duration to be provided on the Android platform for SDK 8 and above. --- framework/src/org/apache/cordova/Capture.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/framework/src/org/apache/cordova/Capture.java b/framework/src/org/apache/cordova/Capture.java index 1ed99d0e..e6b94bc9 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); }