I need to download an mp3 file from my firebase storage gs://fir-b9532.appspot.com/songs/song1.mp3 and play it into my android application. I want to store the mp3 file temporar
Instead of downloading the audio file and temporarly keep it on the memory i found another solution by live-streaming the song from the full URL that firebase storage provide ("https://firebasestorage.googleapis.com/v0/b/fir-b9532.appspot.com/o/songs%2Fsong1.mp3?alt=media&token=a4424b28-93c3-4a0c-a6b9-9136dcf63335").
I just load my MediaPlayer like this:
try {
MediaPlayer player = new MediaPlayer();
player.setAudioStreamType(AudioManager.STREAM_MUSIC);
player.setDataSource("https://firebasestorage.googleapis.com/v0/b/fir-b9532.appspot.com/o/songs%2Fsong1.mp3?alt=media&token=a4424b28-93c3-4a0c-a6b9-9136dcf63335");
player.prepare();
player.start();
} catch (Exception e) {
// TODO: handle exception
}