Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MediaPlayer stops streaming audio playback

I use MediaPlayer to play mp3 stream via http. On some specific devices it doesn't reach the end of the stream too often. Just stops. It occurs only on 2.3.x, can not catch this problem on Jelly Bean. The only strange lines in logcat:

02-04 17:34:14.379: ERROR/HTTPStream(95): recv failed, server is gone, total received: 54683 bytes
02-04 17:34:14.379: ERROR/HTTPStream(95): recv failed, errno = 9 (Bad file number)
02-04 17:34:14.379: ERROR/NuCachedSource2(95): source returned error -1004

OnCompletionListener is called (too early)

Seems like it downloads only 5MB of the stream and doesn't try do download more.

Happens mostly on Samsung Galaxy Ace devices.

like image 228
Taras Avatar asked Feb 04 '13 15:02

Taras


1 Answers

you can try this android media player connecting status with audio streaming link(ie 2%,4%...100% then online radio start to play) in android

this perfectly play streaming mp3 via http. or just go http://coderfriend.blogspot.com/ blog.

like image 76
Mohammad tanvirul islam Avatar answered Sep 22 '22 15:09

Mohammad tanvirul islam