Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MediaPlayer stops and restarts

I get a weird error. I play with a MediaPlayer a mediastream (like shoutcast or icecast).
Sometimes suddenly on playing stream (total random) happens a error, the stream stops and restart.
OnErrorListener don't get triggered!

Logcat:

03-02 17:50:36.274: W/MediaPlayer(16799): info/warning (702, 0)
03-02 17:50:36.274: I/MediaPlayer(16799): Info (702,0)

or like this:

03-02 17:50:14.250: W/MediaPlayer(16799): info/warning (703, 0)
03-02 17:50:14.250: W/MediaPlayer(16799): info/warning (701, 0)
03-02 17:50:14.250: I/MediaPlayer(16799): Info (703,0)
03-02 17:50:14.250: I/MediaPlayer(16799): Info (701,0)

or

03-02 18:03:33.906: W/MediaPlayer(16799): info/warning (703, 126) <br>
03-02 18:03:33.906: I/MediaPlayer(16799): Info (703,126)

Any ideas on that?

Edit:

Ahh. One more information. 701 means MEDIA_INFO_BUFFERING_START and 702 means MEDIA_INFO_BUFFERING_END. I think I could fix these if I increase buffer size?

Edit: But wait. BufferingSize is baked into the system. Damned. :)

like image 913
Leandros Avatar asked Mar 02 '12 17:03

Leandros


2 Answers

As you wrote, buffering...

Sorry, No other suggestions.

like image 159
AlikElzin-kilaka Avatar answered Oct 05 '22 12:10

AlikElzin-kilaka


It is buffering as you wrote - the only thing I'd like to add is that while it's annoying that it stops or starts, this information is very useful to your user. You may want to update him with a Toast (or a Crouton!) or indicate some sort of buffering status so that they don't blame your app (they will anyway usually!) or so that they know that it's likely their connection to blame - connecting to WIFI in this case is an action that would help.

like image 25
StackOverflowed Avatar answered Oct 05 '22 11:10

StackOverflowed