exposing volume control

This commit is contained in:
Kevin Griffin
2011-08-09 23:18:01 -04:00
parent 8c7db9aa32
commit ad8086fab5
3 changed files with 48 additions and 13 deletions
+12 -2
View File
@@ -7,8 +7,6 @@
*/
package com.phonegap;
import java.io.File;
import java.io.IOException;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
@@ -18,6 +16,9 @@ import android.media.MediaRecorder;
import android.os.Environment;
import android.util.Log;
import java.io.File;
import java.io.IOException;
/**
* This class implements the audio playback and recording capabilities used by PhoneGap.
* It is called by the AudioHandler PhoneGap class.
@@ -417,4 +418,13 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
this.state = state;
}
/**
* Set the volume for audio player
*
* @param volume
*/
public void setVolume(float volume) {
this.mPlayer.setVolume(volume, volume);
}
}