incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bows...@apache.org
Subject [11/16] android commit: CB-446: Enhance setting data source for local files in AudioPlayer
Date Tue, 10 Apr 2012 21:39:21 GMT
CB-446: Enhance setting data source for local files in AudioPlayer


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

Branch: refs/heads/CordovaWebView
Commit: ecebcbabf82968472cfe66839862d669fe5e0564
Parents: aa00e07
Author: macdonst <simon.macdonald@gmail.com>
Authored: Mon Apr 9 10:13:43 2012 -0400
Committer: macdonst <simon.macdonald@gmail.com>
Committed: Mon Apr 9 10:13:43 2012 -0400

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


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/ecebcbab/framework/src/org/apache/cordova/AudioPlayer.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/AudioPlayer.java b/framework/src/org/apache/cordova/AudioPlayer.java
index 0bea455..35b408a 100755
--- a/framework/src/org/apache/cordova/AudioPlayer.java
+++ b/framework/src/org/apache/cordova/AudioPlayer.java
@@ -28,6 +28,7 @@ import android.os.Environment;
 import android.util.Log;
 
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.IOException;
 
 /**
@@ -218,7 +219,8 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener,
On
                     else {
                         File fp = new File(file);
                         if (fp.exists()) {
-                            this.mPlayer.setDataSource(file);
+                            FileInputStream fileInputStream = new FileInputStream(file);
+                            this.mPlayer.setDataSource(fileInputStream.getFD());
                         } 
                         else {
                             this.mPlayer.setDataSource("/sdcard/" + file);


Mime
View raw message