Navdroid
Navdroid

Reputation: 1549

How to get online audio streaming from a website with different urls?

I have got a website which shows a list of audio files mp3 format. Each one is having their own URL. I want to know how could I read all the files url into my app and use it for audio streaming? Main emphasis is own how to read the url.

Upvotes: 0

Views: 188

Answers (1)

Angie
Angie

Reputation: 277

you should parse it(your website) to get all url and play it(the song or list of songs) one by one or in list this may help you to start :

String url = "http://........"; // your URL here MediaPlayer mediaPlayer = new MediaPlayer(); mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); mediaPlayer.setDataSource(url); mediaPlayer.prepareAsync(); mediaPlayer.start();

Upvotes: 1

Related Questions