Search code examples
androidmedia-player

Problem with mediaplayer to play live streaming audio in android


I have created one songs album app. In this app, i have to play the songs by using URLs. These URLs gave me 2 types of songs.The first one is on-demand songs, which are our regular songs limited to 5 or 6 minutes. I dont have any problems to play/stop these songs with MediaPlayer object. The second one is live streaming, which is nothing but shout casting.With this shout-casting URLs, the MediaPlayer object is not working properly that means after playing say some 5 seconds of song the mediaplyer stops playing. I dont know what is the problem with live streaming data. if anyone knows about this, please guide me to rock the Mediaplayer.

Thanks Venu


Solution

  • To play live streaming we need to set mp.setAudioStreamType(AudioManager.STREAM_MUSIC); It works for me a lot.