You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2013/07/31 23:23:51 UTC

git commit: CB-4471: Mitigating Android 4.3 errors where it's not passing the data for video. Strange behaviour introduced with 4.3

Updated Branches:
  refs/heads/master 5ffbcd078 -> b2318e91f


CB-4471: Mitigating Android 4.3 errors where it's not passing the data for video.  Strange behaviour introduced with 4.3


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/b2318e91
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/b2318e91
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/b2318e91

Branch: refs/heads/master
Commit: b2318e91f154e62e25ba30ed5de9ce8626baf163
Parents: 5ffbcd0
Author: Joe Bowser <bo...@apache.org>
Authored: Wed Jul 31 14:23:23 2013 -0700
Committer: Joe Bowser <bo...@apache.org>
Committed: Wed Jul 31 14:23:33 2013 -0700

----------------------------------------------------------------------
 src/android/Capture.java | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/b2318e91/src/android/Capture.java
----------------------------------------------------------------------
diff --git a/src/android/Capture.java b/src/android/Capture.java
index 780d092..a5a6ef7 100644
--- a/src/android/Capture.java
+++ b/src/android/Capture.java
@@ -307,14 +307,21 @@ public class Capture extends CordovaPlugin {
                 // Get the uri of the video clip
                 Uri data = intent.getData();
                 // create a file object from the uri
-                results.put(createMediaFile(data));
+                if(data == null)
+                {
+                    this.fail(createErrorObject(CAPTURE_NO_MEDIA_FILES, "Error: data is null"));
+                }
+                else
+                {
+                    results.put(createMediaFile(data));
 
-                if (results.length() >= limit) {
-                    // Send Uri back to JavaScript for viewing video
-                    this.callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, results));
-                } else {
-                    // still need to capture more video clips
-                    captureVideo(duration);
+                    if (results.length() >= limit) {
+                        // Send Uri back to JavaScript for viewing video
+                        this.callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, results));
+                    } else {
+                        // still need to capture more video clips
+                        captureVideo(duration);
+                    }
                 }
             }
         }