开发者

Problem with mediaplayer to play live streaming audio in android

开发者 https://www.devze.com 2023-01-22 16:38 出处:网络
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 song

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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号