cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [4/9] git commit: CB-4471: Mitigating Android 4.3 errors where it's not passing the data for video. Strange behaviour introduced with 4.3
Date Wed, 14 Aug 2013 22:48:48 GMT
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/dev
Commit: b2318e91f154e62e25ba30ed5de9ce8626baf163
Parents: 5ffbcd0
Author: Joe Bowser <bowserj@apache.org>
Authored: Wed Jul 31 14:23:23 2013 -0700
Committer: Joe Bowser <bowserj@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);
+                    }
                 }
             }
         }


Mime
View raw message