PabbleDabble commented on a change in pull request #215:
URL: 
https://github.com/apache/cordova-plugin-media-capture/pull/215#discussion_r677409238



##########
File path: src/android/Capture.java
##########
@@ -399,32 +432,18 @@ public void onImageActivityResult(Request req) {
     }
 
     public void onVideoActivityResult(Request req, Intent intent) {
-        Uri data = null;
-
-        if (intent != null){
-            // Get the uri of the video clip
-            data = intent.getData();
-        }
-
-        if( data == null){
-            File movie = new File(getTempDirectoryPath(), "Capture.avi");
-            data = Uri.fromFile(movie);
-        }
-
-        // create a file object from the uri
-        if(data == null) {
+        if(this.videoAbsolutePath != null) {
+            
req.results.put(createMediaFileWithAbsolutePath(this.videoAbsolutePath));
+        } else {
             pendingRequests.resolveWithFailure(req, 
createErrorObject(CAPTURE_NO_MEDIA_FILES, "Error: data is null"));
         }
-        else {
-            req.results.put(createMediaFile(data));
 
-            if (req.results.length() >= req.limit) {
-                // Send Uri back to JavaScript for viewing video
-                pendingRequests.resolveWithSuccess(req);
-            } else {
-                // still need to capture more video clips
-                captureVideo(req);
-            }
+        if (req.results.length() >= req.limit) {
+            // Send Uri back to JavaScript for viewing video
+            pendingRequests.resolveWithSuccess(req);
+        } else {
+            // still need to capture more videos
+            captureVideo(req);
         }
     }
 

Review comment:
       @chriskhongqarma Sorry if this is the incorrect place for this comment.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to