mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 15:12:51 +08:00
added file requirement to constructor, all references to AudioPlayer constructor had direct access to file, so this caused no other changes
This commit is contained in:
parent
3c9415b1c2
commit
d16555ec4b
@ -74,7 +74,7 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
|
||||
private String tempFile = null; // Temporary recording file name
|
||||
|
||||
private MediaPlayer mPlayer = null; // Audio player object
|
||||
private boolean prepareOnly = false;
|
||||
private boolean prepareOnly = false;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@ -82,9 +82,10 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
|
||||
* @param handler The audio handler object
|
||||
* @param id The id of this audio player
|
||||
*/
|
||||
public AudioPlayer(AudioHandler handler, String id) {
|
||||
public AudioPlayer(AudioHandler handler, String id, String src) {
|
||||
this.handler = handler;
|
||||
this.id = id;
|
||||
this.audioFile = src;
|
||||
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
||||
this.tempFile = Environment.getExternalStorageDirectory().getAbsolutePath() + "/tmprecording.mp3";
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user