incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject [14/14] android commit: added create message handler, updated AudioPlayer constructor usage
Date Thu, 12 Jul 2012 21:44:09 GMT
added create message handler, updated AudioPlayer constructor usage


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/3c9415b1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/3c9415b1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/3c9415b1

Branch: refs/heads/master
Commit: 3c9415b1c2d0056cad8c2c49a0a22ceef577b11a
Parents: aa45670
Author: Lorin Beer <lorin.beer@nitobi.com>
Authored: Sun Jun 17 22:18:09 2012 -0700
Committer: Lorin Beer <lorin.beer@nitobi.com>
Committed: Sun Jun 17 22:18:09 2012 -0700

----------------------------------------------------------------------
 framework/src/org/apache/cordova/AudioHandler.java |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/3c9415b1/framework/src/org/apache/cordova/AudioHandler.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/AudioHandler.java b/framework/src/org/apache/cordova/AudioHandler.java
index a866d4f..9da04f0 100755
--- a/framework/src/org/apache/cordova/AudioHandler.java
+++ b/framework/src/org/apache/cordova/AudioHandler.java
@@ -96,6 +96,12 @@ public class AudioHandler extends Plugin {
                 float f = this.getDurationAudio(args.getString(0), args.getString(1));
                 return new PluginResult(status, f);
             }
+            else if (action.equals("create")) {
+            	String id = args.getString(0);
+            	String src = args.getString(1);
+            	AudioPlayer audio = new AudioPlayer(this, id, src);
+            	this.players.put(id, audio);
+            }
             else if (action.equals("release")) {
                 boolean b = this.release(args.getString(0));
                 return new PluginResult(status, b);
@@ -196,7 +202,7 @@ public class AudioHandler extends Plugin {
         if (this.players.containsKey(id)) {
             return;
         }
-        AudioPlayer audio = new AudioPlayer(this, id);
+        AudioPlayer audio = new AudioPlayer(this, id, file);
         this.players.put(id, audio);
         audio.startRecording(file);
     }
@@ -221,7 +227,7 @@ public class AudioHandler extends Plugin {
     public void startPlayingAudio(String id, String file) {
         AudioPlayer audio = this.players.get(id);
         if (audio == null) {
-            audio = new AudioPlayer(this, id);
+            audio = new AudioPlayer(this, id, file);
             this.players.put(id, audio);
         }
         audio.startPlaying(file);
@@ -292,7 +298,7 @@ public class AudioHandler extends Plugin {
 
         // If not already open, then open the file
         else {
-            audio = new AudioPlayer(this, id);
+            audio = new AudioPlayer(this, id, file);
             this.players.put(id, audio);
             return (audio.getDuration(file));
         }


Mime
View raw message