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 <matrosov.nikit...@gmail.com> Authored: Wed Oct 26 14:39:10 2016 +0300 Committer: Vladimir Kotikov <kotikov.vladi...@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-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org