6

I use below code to play streaming music:

try {
    MediaPlayer mediaPlayer = new MediaPlayer();

    mediaPlayer.setDataSource(URL);
    mediaPlayer.prepare();
    mediaPlayer.start();
}
catch(Exception e) {
    e.printStackTrace();
}

I want to buffering file to local cache file at the same time.
And next time want to play this url music can play the local file directly.
How can I do it?
Or anyone can provide references?

brian
  • 6,802
  • 29
  • 83
  • 124
  • This is a [duplicate](http://stackoverflow.com/questions/12701249/getting-access-to-media-player-cache) - and again [here](http://stackoverflow.com/questions/13108846/android-mediaplayer-downloading-and-streaming-at-same-time-revisited/18628334#18628334). @brian See my answer on the first link. – Dave Dec 05 '13 at 09:46

0 Answers0