cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tim...@apache.org
Subject [2/3] git commit: Fixed a few references
Date Tue, 18 Jun 2013 00:11:36 GMT
Fixed a few references


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/commit/27ccee1b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/tree/27ccee1b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/diff/27ccee1b

Branch: refs/heads/master
Commit: 27ccee1b8afad4a330f09fcaa56273ef6e407e00
Parents: 2f0a74b
Author: Tim Kim <timk@adobe.com>
Authored: Mon Jun 17 17:11:19 2013 -0700
Committer: Tim Kim <timk@adobe.com>
Committed: Mon Jun 17 17:11:19 2013 -0700

----------------------------------------------------------------------
 src/android/AudioHandler.java | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/27ccee1b/src/android/AudioHandler.java
----------------------------------------------------------------------
diff --git a/src/android/AudioHandler.java b/src/android/AudioHandler.java
index 20c3c4e..787de93 100644
--- a/src/android/AudioHandler.java
+++ b/src/android/AudioHandler.java
@@ -16,11 +16,12 @@
        specific language governing permissions and limitations
        under the License.
 */
-package org.apache.cordova;
+package org.apache.cordova.core;
 
+import org.apache.cordova.FileHelper;
 import org.apache.cordova.api.CallbackContext;
 import org.apache.cordova.api.CordovaPlugin;
-import org.apache.cordova.api.DataResource;
+
 import android.content.Context;
 import android.media.AudioManager;
 
@@ -56,11 +57,6 @@ public class AudioHandler extends CordovaPlugin {
         this.pausedForPhone = new ArrayList<AudioPlayer>();
     }
 
-    public String getFilePath(String url, String source){
-        DataResource dataResource = DataResource.initiateNewDataRequestForUri(url, this.webView.pluginManager,
cordova, source);
-        return dataResource.getRealFile().getPath();
-    }
-
     /**
      * Executes the request and returns PluginResult.
      * @param action 		The action to execute.
@@ -73,13 +69,13 @@ public class AudioHandler extends CordovaPlugin {
         String result = "";
 
         if (action.equals("startRecordingAudio")) {
-            this.startRecordingAudio(args.getString(0), getFilePath(args.getString(1), "AudioHandler.startRecordingAudio"));
+            this.startRecordingAudio(args.getString(0), FileHelper.stripFileProtocol(args.getString(1)));
         }
         else if (action.equals("stopRecordingAudio")) {
             this.stopRecordingAudio(args.getString(0));
         }
         else if (action.equals("startPlayingAudio")) {
-            this.startPlayingAudio(args.getString(0), getFilePath(args.getString(1), "AudioHandler.startPlayingAudio"));
+            this.startPlayingAudio(args.getString(0), FileHelper.stripFileProtocol(args.getString(1)));
         }
         else if (action.equals("seekToAudio")) {
             this.seekToAudio(args.getString(0), args.getInt(1));
@@ -107,7 +103,7 @@ public class AudioHandler extends CordovaPlugin {
         }
         else if (action.equals("create")) {
             String id = args.getString(0);
-            String src = getFilePath(args.getString(1), "AudioHandler.create");
+            String src = FileHelper.stripFileProtocol(args.getString(1));
             AudioPlayer audio = new AudioPlayer(this, id, src);
             this.players.put(id, audio);
         }


Mime
View raw message