вот он игрок
private void initPlayer(final int position) {
if (mMediaPlayer != null && mMediaPlayer.isPlaying()) {
mMediaPlayer.reset();
}
String sname = mySongs.get(position).getName().replace(".mp3", "").replace(".m4a", "").replace(".wav", "").replace(".m4b", "");
songTitle.setText(sname);
// I am taking the song data as uri
Uri songResourceUri = Uri.parse(mySongs.get(position).toString());
mMediaPlayer = MediaPlayer.create(getApplicationContext(), songResourceUri); // create and load mediaplayer with song resources
mMediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
String totalTime = createTimeLabel(mMediaPlayer.getDuration());
totTime.setText(totalTime);
mSeekBar.setMax(mMediaPlayer.getDuration());
mMediaPlayer.start();
playIcon.setBackgroundResource(R.drawable.stop);
}
});