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 2012/05/09 17:27:17 UTC
[3/5] bada-wac commit: adding captureVideo example
adding captureVideo example
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-bada-wac/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-bada-wac/commit/085fd431
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-bada-wac/tree/085fd431
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-bada-wac/diff/085fd431
Branch: refs/heads/master
Commit: 085fd431203a31432941e25e2adbb7973b3f8e79
Parents: 8511f42
Author: Anis Kadri <an...@gmail.com>
Authored: Wed May 9 05:54:56 2012 -0700
Committer: Anis Kadri <an...@gmail.com>
Committed: Wed May 9 05:54:56 2012 -0700
----------------------------------------------------------------------
Res/js/sample.js | 28 +++++++++++++++++++++-------
1 files changed, 21 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-bada-wac/blob/085fd431/Res/js/sample.js
----------------------------------------------------------------------
diff --git a/Res/js/sample.js b/Res/js/sample.js
index 5ed8889..1a6c0e8 100644
--- a/Res/js/sample.js
+++ b/Res/js/sample.js
@@ -267,31 +267,45 @@ function captureImage2() {
function getPicture() {
var success = function(imageURI) {
var i;
- var images = document.getElementById("images");
+ var media = document.getElementById("media");
var image = document.createElement("img");
image.src = imageURI;
image.style.width = "256px";
- images.appendChild(image);
+ media.appendChild(image);
};
var fail = function(error) {
console.log("ERROR"+JSON.stringify(error));
};
- navigator.camera.getPicture(success, fail);
+ navigator.camera.getPicture(success, fail, {});
}
function captureImage() {
var success = function(mediaFiles) {
var i;
- var images = document.getElementById("images");
+ var media = document.getElementById("media");
for(i = 0 ; i < mediaFiles.length ; i += 1) {
var image = document.createElement("img");
- image.src = mediaFiles[i].path;
+ image.src = mediaFiles[i].fullPath;
image.style.width = "256px";
- images.appendChild(image);
+ media.appendChild(image);
}
};
var fail = function(error) {
console.log("ERROR"+JSON.stringify(error));
};
- navigator.capture.captureImage(success, fail);
+ navigator.device.capture.captureImage(success, fail);
+}
+
+function captureVideo() {
+ var success = function(mediaFiles) {
+ var i;
+ var media = document.getElementById("media");
+ for(i = 0 ; i < mediaFiles.length ; i += 1) {
+ console.log(mediaFiles[i].fullPath);
+ }
+ };
+ var fail = function(error) {
+ console.log(error);
+ };
+ navigator.device.capture.captureVideo(success, fail);
}
\ No newline at end of file