Search code examples
javaandroidmedia-player

Shoutcast stream work in 2.3 but not in 2.2


my App works very well on android 2.3+ (testing on avd's). But on android 2.2 android mp log me an error

01-11 17:47:21.862: E/MediaPlayer(314): error (1, -2147483648)
01-11 17:47:21.891: E/MediaPlayer(314): Error (1,-2147483648)

or

01-11 17:50:17.091: E/MediaPlayer(328): error (100, 0)
01-11 17:50:17.103: E/MediaPlayer(328): Error (100,0)

Can someone help me to "decode" those error codes?

My code is very simple, (this is the MediaPlayer part)

MediaPlayer mp = new MediaPlayer(); 
mp.setOnPreparedListener(this);
mp.setAudioStreamType(AudioManager.STREAM_MUSIC);
mp.setDataSource(soundUrl);
mp.prepareAsync();

@Override
public void onCreate(MediaPlayer mp) {
mp.start();
}



edit: I solved it. I inserted the direct link to the shoutcast directory. It seems that android 2.2 cant resolve the links.

eg: http://listen.technobase.fm/tunein-dsl-pls turned into http://85.17.26.115/


Solution

  • I inserted the direct link to the shoutcast directory. It seems that android 2.2 cant resolve the links.

    eg: http://listen.technobase.fm/tunein-dsl-pls turned into http://85.17.26.115/