You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2016/12/08 00:57:19 UTC
[7/8] cordova-plugin-media-capture git commit: CB-10701 CB-7117
android: Add manual test to check getting metadata
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/1.4.x
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