Streaming mp3 (radio) using MediaPlayer wont work

All your problems with Audio, Video and Images.

Streaming mp3 (radio) using MediaPlayer wont work

Postby zephir » Wed Feb 02, 2011 3:02 pm

Hello,

i searched alot on google and here. Could not find any good resource to go with.

Basically there are people like me who cannot get it to work and others who say they use MediaPlayer for playing streaming mp3 radio streams but never provide proof of any kind.

What i do:

Code: Select all
MediaPlayer mp = new MediaPlayer();
mp.setDataSource("http://any-streaming-server/file.mp3");
mp.prepare();  // also tried with mp.prepareAsync() combined with an onPreparedListener
mp.play();


No matter how i try it, i always end up with an error. Can this even work? Any help?

Thank you,

if needed i can provide more info regarding code and the errors/exceptions thrown
zephir
Freshman
Freshman
 
Posts: 2
Joined: Wed Feb 02, 2011 2:43 pm

Top

Re: Streaming mp3 (radio) using MediaPlayer wont work

Postby wakawaka » Thu Feb 10, 2011 1:16 pm

I am also facing same problem. Any pointer to solve this.
Android Development Tutorials and Code Snippets: http://forum.gssdaily.com/
wakawaka
Experienced Developer
Experienced Developer
 
Posts: 79
Joined: Tue Jan 11, 2011 1:51 pm

Re: Streaming mp3 (radio) using MediaPlayer wont work

Postby Kerbik » Fri Feb 11, 2011 2:23 pm

Yes, it is possible, i done it succesfully yesterday evening :) , I will post here more when i will get back to home :) so in about 3 hours :).

Kerbik
Kerbik
Developer
Developer
 
Posts: 30
Joined: Fri May 28, 2010 6:06 am

Re: Streaming mp3 (radio) using MediaPlayer wont work

Postby Kerbik » Tue Feb 15, 2011 7:23 am

Hello guys,
I'm sorry for really really long dealay but here it is and it should work didn't try exactly this code but somehow this way i done it succesfully

Code: Select all
   private MediaPlayer mMediaPlayer;
   Uri uri = Uri.parse("http://www.jjyyjy.com/wj/he.mp3";);
   mMediaPlayer = MediaPlayer.create(this, uri);
   mMediaPlayer.start();


Kerbik.
Kerbik
Developer
Developer
 
Posts: 30
Joined: Fri May 28, 2010 6:06 am

Re: Streaming mp3 (radio) using MediaPlayer wont work

Postby ukemasta » Wed Feb 23, 2011 7:42 pm

How did you stream that file? I can't figure out how to stream a mp3.
ukemasta
Freshman
Freshman
 
Posts: 7
Joined: Tue Feb 22, 2011 8:10 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 18 guests