PabbleDabble commented on a change in pull request #215: URL: https://github.com/apache/cordova-plugin-media-capture/pull/215#discussion_r677408919
########## 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: Should `createMediaFile(Uri data)` be removed? It doesn't appear to be used / replaced with `createMediaFileWithAbsolutePath(String path)` -- 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: issues-unsubscr...@cordova.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org