Code example for MediaPlayer

Methods: isPlaying

0
			mediaPlayer.setVolume(volume, volume);
		} 
	} 
 
	private boolean mayKeepSong(String fileName) {
		return (fileName.equals(currentTrack) && mediaPlayer.isPlaying());
	} 
 
	public void play(String fileName, float volume, float speed, boolean loop) {
		if (globalVolume * volume <= 0.0f)
			return; 
 
		if (mediaPlayer != null) {
			if (mayKeepSong(fileName)) {
				return; 
			} else { 
				mediaPlayer.stop();
			} 
		} 
		currentTrack = fileName;