How to cache into disk audio streamed into MediaPlayer? I'd like to use cached audio instead of downloading it each time. Unfortunately setDataSource
even do not accepts InputStream
, so I don't know solution.. My code:
mediaPlayer.setDataSource(context, Uri.parse(/* file url */));
mediaPlayer.prepare();
mediaPlayer.start();