Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why won't this Java Android SHOUTcast MediaPlayer app code work?

    String url = "http://91.121.140.11:8000/";
    MediaPlayer mediaPlayer = new MediaPlayer();
    mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
    mediaPlayer.setDataSource(url);
    mediaPlayer.prepare();
    mediaPlayer.start();

I am using Android 4.0.3 to test this and have tried it on a physical device and the emulator. The app opens but I cannot hear anything. I thought they added support for SHOUTcast streams. Have I done something wrong?

like image 340
David Zorychta Avatar asked Feb 02 '26 06:02

David Zorychta


1 Answers

I was having the same issue so I decided simply to try it on a real device (4.0.4). It worked. Seems like an emulator issue to me.

like image 103
Binary Boy Avatar answered Feb 03 '26 18:02

Binary Boy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!