incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [5/40] git commit: MediaStatus + Notification API
Date Fri, 06 Apr 2012 01:20:42 GMT
MediaStatus + Notification API


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/20af74ec
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/20af74ec
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/20af74ec

Branch: refs/heads/master
Commit: 20af74ec37a69fe74fde101af2806a5ddb78d118
Parents: 6dc6f3a
Author: Jesse MacFadyen <purplecabbage@gmail.com>
Authored: Wed Apr 4 17:49:19 2012 -0700
Committer: Jesse MacFadyen <purplecabbage@gmail.com>
Committed: Wed Apr 4 17:49:19 2012 -0700

----------------------------------------------------------------------
 lib/wp7/exec.js                            |   54 +++++++++++++++++++++++
 lib/wp7/platform.js                        |    6 +++
 lib/wp7/plugin/wp7/CordovaMediaonStatus.js |    9 ++++
 3 files changed, 69 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/20af74ec/lib/wp7/exec.js
----------------------------------------------------------------------
diff --git a/lib/wp7/exec.js b/lib/wp7/exec.js
index 09632df..b9b09ec 100644
--- a/lib/wp7/exec.js
+++ b/lib/wp7/exec.js
@@ -96,6 +96,60 @@ var MonkeyPatch =
 		{
 			return arg[0];	
 		}
+	},
+	Media:
+	{
+		create:function(arg)
+		{
+			return {id:arg[0],src:arg[1]};
+		},
+		startPlayingAudio:function(arg)
+		{
+			return {id:arg[0],src:arg[1],milliseconds:arg[2]};
+		},
+		stopPlayingAudio:function(arg)
+		{
+			return {id:arg[0]};
+		},
+		seekToAudio:function(arg)
+		{
+			return {id:arg[0],milliseconds:arg[1]};
+		},
+		pausePlayingAudio:function(arg)
+		{
+			return {id:arg[0]};
+		},
+		getCurrentPositionAudio:function(arg)
+		{
+			return {id:arg[0]};
+		},
+		startRecordingAudio:function(arg)
+		{
+			return {id:arg[0],src:arg[1]};
+		},
+		stopRecordingAudio:function(arg)
+		{
+			return {id:arg[0]};
+		},
+		release:function(arg)
+		{
+			return {id:arg[0]};
+		},
+		setVolume:function(arg)
+		{
+			return {id:arg[0],volume:arg[1]};
+		}
+	},
+	Notification:
+	{
+		"alert":function(arg)
+		{
+			return {message:arg[0],title:arg[1],buttonLabel:arg[2]};
+		},
+		"confirm":function(arg)
+		{
+			return {message:arg[0],title:arg[1],buttonLabel:arg[2]};
+		}
 	}
 	
 };

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/20af74ec/lib/wp7/platform.js
----------------------------------------------------------------------
diff --git a/lib/wp7/platform.js b/lib/wp7/platform.js
index 0cc8ddf..fd511ab 100644
--- a/lib/wp7/platform.js
+++ b/lib/wp7/platform.js
@@ -4,10 +4,13 @@ module.exports = {
     id: "wp7",
     initialize:function() {
 
+console.log("window.CordovaMediaonStatus = " + window.CordovaMediaonStatus);
 
 if(!window.localStorage)
 {(function()
 {
+	
+	
 
     var DOMStorage = function(type)
     {
@@ -210,6 +213,9 @@ if(!window.localStorage)
 		CordovaCommandResult: {
 			path:"cordova/plugin/wp7/CordovaCommandResult"
 		},
+		CordovaMediaonStatus: {
+			path:"cordova/plugin/wp7/CordovaMediaonStatus"
+		},
 		requestFileSystem: {
 			path:"cordova/plugin/wp7/requestFileSystem"
 		},

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/20af74ec/lib/wp7/plugin/wp7/CordovaMediaonStatus.js
----------------------------------------------------------------------
diff --git a/lib/wp7/plugin/wp7/CordovaMediaonStatus.js b/lib/wp7/plugin/wp7/CordovaMediaonStatus.js
new file mode 100644
index 0000000..b77415d
--- /dev/null
+++ b/lib/wp7/plugin/wp7/CordovaMediaonStatus.js
@@ -0,0 +1,9 @@
+
+var cordova = require('cordova');
+
+module.exports = function(args) {
+	
+	console.log("media on status :: " + args);
+	//var res = JSON.parse(args);
+    //require("cordova/media").onStatus(res.id, res.msg, res.value);
+};


Mime
View raw message