You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2016/10/26 13:08:54 UTC
[1/3] cordova-plugin-media-capture git commit: CB-10488 Fix for
MediaFile.getFormatData
Repository: cordova-plugin-media-capture
Updated Branches:
refs/heads/master cd7d40d5d -> 7e28e9cb1
CB-10488 Fix for MediaFile.getFormatData
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/ab8b6330
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/ab8b6330
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/ab8b6330
Branch: refs/heads/master
Commit: ab8b63308c1df274b7c98f816ee7f41fcec98313
Parents: cd7d40d
Author: TanaseButcaru <co...@butcaru.com>
Authored: Mon Feb 1 00:42:07 2016 +0200
Committer: Vladimir Kotikov <ko...@gmail.com>
Committed: Wed Oct 26 14:52:16 2016 +0300
----------------------------------------------------------------------
www/MediaFile.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/ab8b6330/www/MediaFile.js
----------------------------------------------------------------------
diff --git a/www/MediaFile.js b/www/MediaFile.js
index 1bc600f..49b73be 100644
--- a/www/MediaFile.js
+++ b/www/MediaFile.js
@@ -48,7 +48,7 @@ MediaFile.prototype.getFormatData = function(successCallback, errorCallback) {
if (typeof this.fullPath === "undefined" || this.fullPath === null) {
errorCallback(new CaptureError(CaptureError.CAPTURE_INVALID_ARGUMENT));
} else {
- exec(successCallback, errorCallback, "Capture", "getFormatData", [this.localURL, this.type]);
+ exec(successCallback, errorCallback, "Capture", "getFormatData", [this.fullPath, this.type]);
}
};
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[2/3] cordova-plugin-media-capture git commit: CB-10489 Fix for
MediaFile.getFormatData / audio recording support
Posted by an...@apache.org.
CB-10489 Fix for MediaFile.getFormatData / audio recording support
This closes #53
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/26f9ad10
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/26f9ad10
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/26f9ad10
Branch: refs/heads/master
Commit: 26f9ad109552f86f0052a1ca325a03bb07db3d16
Parents: ab8b633
Author: TanaseButcaru <co...@butcaru.com>
Authored: Wed Feb 3 23:49:06 2016 +0200
Committer: Vladimir Kotikov <ko...@gmail.com>
Committed: Wed Oct 26 16:04:43 2016 +0300
----------------------------------------------------------------------
src/android/Capture.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/26f9ad10/src/android/Capture.java
----------------------------------------------------------------------
diff --git a/src/android/Capture.java b/src/android/Capture.java
index 1f7030b..40117aa 100644
--- a/src/android/Capture.java
+++ b/src/android/Capture.java
@@ -25,6 +25,7 @@ import java.io.OutputStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.util.Arrays;
import android.os.Build;
import android.os.Bundle;
@@ -61,6 +62,7 @@ public class Capture extends CordovaPlugin {
private static final String VIDEO_3GPP = "video/3gpp";
private static final String VIDEO_MP4 = "video/mp4";
private static final String AUDIO_3GPP = "audio/3gpp";
+ private static final String[] AUDIO_TYPES = new String[] {"audio/3gpp", "audio/aac", "audio/amr", "audio/wav"};
private static final String IMAGE_JPEG = "image/jpeg";
private static final int CAPTURE_AUDIO = 0; // Constant for capture audio
@@ -169,7 +171,7 @@ public class Capture extends CordovaPlugin {
if (mimeType.equals(IMAGE_JPEG) || filePath.endsWith(".jpg")) {
obj = getImageData(fileUrl, obj);
}
- else if (mimeType.endsWith(AUDIO_3GPP)) {
+ else if (Arrays.asList(AUDIO_TYPES).contains(mimeType)) {
obj = getAudioVideoData(filePath, obj, false);
}
else if (mimeType.equals(VIDEO_3GPP) || mimeType.equals(VIDEO_MP4)) {
@@ -454,7 +456,7 @@ public class Capture extends CordovaPlugin {
try {
// File properties
obj.put("name", fp.getName());
- obj.put("fullPath", fp.toURI().toString());
+ obj.put("fullPath", Uri.fromFile(fp));
if (url != null) {
obj.put("localURL", url.toString());
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[3/3] cordova-plugin-media-capture git commit: CB-10701 CB-7117
android: Add manual test to check getting metadata
Posted by an...@apache.org.
CB-10701 CB-7117 android: Add manual test to check getting metadata
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/7e28e9cb
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/7e28e9cb
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/7e28e9cb
Branch: refs/heads/master
Commit: 7e28e9cb1d60e54ecb1e29e61d38329d9c0e62f0
Parents: 26f9ad1
Author: Nikita Matrosov <ma...@gmail.com>
Authored: Wed Oct 26 14:39:10 2016 +0300
Committer: Vladimir Kotikov <ko...@gmail.com>
Committed: Wed Oct 26 16:06:47 2016 +0300
----------------------------------------------------------------------
tests/tests.js | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/7e28e9cb/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index c3177f4..fd2f60b 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -134,6 +134,7 @@ exports.defineManualTests = function (contentEl, createActionButton) {
log('Audio captured: ' + path);
var m = new Media(path);
m.play();
+ getFileMetadata(mediaFiles[0]);
}
function captureAudioFail(e) {
@@ -213,6 +214,23 @@ exports.defineManualTests = function (contentEl, createActionButton) {
source_vid.src = path;
vid.appendChild(source_vid);
document.getElementById('video_container').appendChild(vid);
+ getFileMetadata(mediaFiles[0]);
+ }
+
+ function getFileMetadata(mediaFile) {
+ mediaFile.getFormatData(getMetadataWin, getMetadataFail);
+ }
+
+ function getMetadataWin(metadata) {
+ var strMetadata =
+ "duration = " + metadata.duration + '\n' +
+ "width = " + metadata.width + '\n' +
+ "height = " + metadata.height;
+ log(strMetadata);
+ }
+
+ function getMetadataFail(e) {
+ log("Error getting metadata: " + e.code);
}
function captureVideoFail(e) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org