Fixed Return Array Bug

Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/7f476e95
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/7f476e95
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/7f476e95

Branch: refs/heads/master
Commit: 7f476e95ef569a0c235f9823bd678d6cd3aec984
Parents: f3539f8
Author: wangmingfeng <mingfengwan...@gmail.com>
Authored: Fri Aug 17 10:25:55 2012 +0800
Committer: wangmingfeng <mingfengwan...@gmail.com>
Committed: Fri Aug 17 10:25:55 2012 +0800

----------------------------------------------------------------------
 lib/win8metro/plugin/win8metro/CaptureProxy.js |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/7f476e95/lib/win8metro/plugin/win8metro/CaptureProxy.js
----------------------------------------------------------------------
diff --git a/lib/win8metro/plugin/win8metro/CaptureProxy.js 
b/lib/win8metro/plugin/win8metro/CaptureProxy.js
index 1c2e509..1864e9e 100755
--- a/lib/win8metro/plugin/win8metro/CaptureProxy.js
+++ b/lib/win8metro/plugin/win8metro/CaptureProxy.js
@@ -34,7 +34,9 @@ module.exports = {
                 var stopRecord = function () {
                     mediaCapture.stopRecordAsync().then(function (result) {
                         storageFile.getBasicPropertiesAsync().then(function 
(basicProperties) {
-                            successCallback(new MediaFile(storageFile.name, 
storageFile.path, storageFile.contentType, basicProperties.dateModified, 
basicProperties.size));
+                            var results = [];
+                            results.push(new MediaFile(storageFile.name, 
storageFile.path, storageFile.contentType, basicProperties.dateModified, 
basicProperties.size));
+                            successCallback(results);
                         }, function () {
                             errorCallback(new 
CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
                         })
@@ -57,7 +59,9 @@ module.exports = {
         
cameraCaptureUI.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.photo).then(function
 (file) {
             file.moveAsync(Windows.Storage.KnownFolders.picturesLibrary, 
"cameraCaptureImage.jpg", 
Windows.Storage.NameCollisionOption.generateUniqueName).then(function () {
                 file.getBasicPropertiesAsync().then(function (basicProperties) 
{
-                    successCallback(new MediaFile(file.name, file.path, 
file.contentType, basicProperties.dateModified, basicProperties.size));
+                    var results = [];
+                    results.push(new MediaFile(file.name, file.path, 
file.contentType, basicProperties.dateModified, basicProperties.size));
+                    successCallback(results);
                 }, function () {
                     errorCallback(new 
CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
                 })
@@ -83,7 +87,9 @@ module.exports = {
         
cameraCaptureUI.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.video).then(function
 (file) {
             file.moveAsync(Windows.Storage.KnownFolders.videosLibrary, 
"cameraCaptureVedio.mp4", 
Windows.Storage.NameCollisionOption.generateUniqueName).then(function () {
                 file.getBasicPropertiesAsync().then(function (basicProperties) 
{
-                    successCallback(new MediaFile(file.name, file.path, 
file.contentType, basicProperties.dateModified, basicProperties.size));
+                    var results = [];
+                    results.push(new MediaFile(file.name, file.path, 
file.contentType, basicProperties.dateModified, basicProperties.size));
+                    successCallback(results);
                 }, function () {
                     errorCallback(new 
CaptureError(CaptureError.CAPTURE_NO_MEDIA_FILES));
                 })
@@ -94,7 +100,7 @@ module.exports = {
     
     },
        
-       getFormatData:function (successCallback, errorCallback, args) {
+    getFormatData:function (successCallback, errorCallback, args) {
            var contentType = args[1];
            
Windows.Storage.StorageFile.getFileFromPathAsync(args[0]).then(function 
(storageFile) {
                    var mediaTypeFlag = 
String(contentType).split("/")[0].toLowerCase();
@@ -125,4 +131,4 @@ module.exports = {
                }
            )
        }
-}
+}      

Reply via email to