You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ia...@apache.org on 2014/04/15 21:26:40 UTC

[1/2] spec commit: Fix camera test to treat content URLs as local

Repository: cordova-mobile-spec
Updated Branches:
  refs/heads/master 9c6d91aa7 -> 4c1720479


Fix camera test to treat content URLs as local


Project: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/commit/18617eef
Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/18617eef
Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/18617eef

Branch: refs/heads/master
Commit: 18617eefb994e42d1177072a8521705951f5d08d
Parents: 9c6d91a
Author: Ian Clelland <ic...@chromium.org>
Authored: Tue Apr 15 14:01:06 2014 -0400
Committer: Ian Clelland <ic...@chromium.org>
Committed: Tue Apr 15 14:01:06 2014 -0400

----------------------------------------------------------------------
 camera/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/18617eef/camera/index.html
----------------------------------------------------------------------
diff --git a/camera/index.html b/camera/index.html
index 6340b8c..b74dabb 100644
--- a/camera/index.html
+++ b/camera/index.html
@@ -96,7 +96,7 @@
     function getPictureWin(data) {
         setPicture(data);
         // TODO: Fix resolveLocalFileSystemURI to work with native-uri.
-        if (pictureUrl.indexOf('file:') == 0) {
+        if (pictureUrl.indexOf('file:') == 0 || pictureUrl.indexOf('content:') == 0) {
             resolveLocalFileSystemURI(data, function(e) {
                 fileEntry = e;
                 logCallback('resolveLocalFileSystemURI()', true)(e.toURL());


[2/2] spec commit: CB-6152: Add manual tests to check interaction between media-capture and file plugins

Posted by ia...@apache.org.
CB-6152: Add manual tests to check interaction between media-capture and file plugins


Project: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/commit/4c172047
Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/4c172047
Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/4c172047

Branch: refs/heads/master
Commit: 4c1720479b98a4631047fa18642daa1d77c398a0
Parents: 18617ee
Author: Ian Clelland <ic...@chromium.org>
Authored: Tue Apr 15 14:04:32 2014 -0400
Committer: Ian Clelland <ic...@chromium.org>
Committed: Tue Apr 15 15:25:45 2014 -0400

----------------------------------------------------------------------
 capture/index.html | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/4c172047/capture/index.html
----------------------------------------------------------------------
diff --git a/capture/index.html b/capture/index.html
index 2d31f53..67c35e3 100644
--- a/capture/index.html
+++ b/capture/index.html
@@ -106,6 +106,39 @@
         var options = { limit: 1, duration: 10 };
         navigator.device.capture.captureVideo(captureVideoWin, captureVideoFail, options);      
     }
+
+    function resolveMediaFileURL(mediaFile, callback) {
+        resolveLocalFileSystemURL(mediaFile.localURL, function(entry) {
+            log("Resolved by URL: " + mediaFile.localURL);
+            if (callback) callback();
+        }, function(err) {
+            log("Failed to resolve by URL: " + mediaFile.localURL);
+            log("Error: " + JSON.stringify(err));
+            if (callback) callback();
+        });
+    }
+
+    function resolveMediaFile(mediaFile, callback) {
+        resolveLocalFileSystemURL(mediaFile.fullPath, function(entry) {
+            log("Resolved by path: " + mediaFile.fullPath);
+            if (callback) callback();
+        }, function(err) {
+            log("Failed to resolve by path: " + mediaFile.fullPath);
+            log("Error: " + JSON.stringify(err));
+            if (callback) callback();
+        });
+    }
+        
+    function resolveVideo() {
+        clearStatus();
+        var options = { limit: 1, duration: 5 };
+        navigator.device.capture.captureVideo(function(mediaFiles) {
+            captureVideoWin(mediaFiles);
+            resolveMediaFile(mediaFiles[0], function() {
+                resolveMediaFileURL(mediaFiles[0]);
+            });
+        }, captureVideoFail, options);      
+    }
     
     function clearStatus() {
         document.getElementById('camera_status').innerHTML = '';
@@ -146,6 +179,7 @@
     <div class="btn large" onclick="getAudio();">Capture 10 secs of audio and play</div>
     <div class="btn large" onclick="getImage();">Capture 1 image</div>
     <div class="btn large" onclick="getVideo();">Capture 10 secs of video</div>
+    <div class="btn large" onclick="resolveVideo();">Capture 5 secs of video and resolve</div>
     <h2> </h2><div class="backBtn" onclick="backHome();">Back</div>
   </body>
 </html>