Assume the following:
- App sets MediaPlayer data source to a remote URL. (http://example.com/podcast.mp3).
- MediaPlayer begins to stream mp3 over 3G. It buffers a bit more data than it is playing to ensure no pauses for buffering.
- Device loses connectivity briefly. MediaPlayer has streamed 40% of file, and buffered 50% of it.
- Device regains connectivity either through WIFI or 3G.
- MediaPlayer does not at this point, continue buffering the mp3 as far as I know.
- Once mediaplayer has reached 50% it stalls.
Unfortunately, without using a proxy, it’s not possible to download and stream an MP3 at the same time (or is it?). That being said, once it hits the stall point, is it possible to continue playing the mp3 with a new connection (if possible, seamlessly?). Is it possible to see how much of an mp3 has been buffered? Is it possible, once the connection is re-established, create a new MediaPlayer connection and “hand off” playback from the first connection to the next?
I can’t answer all of your questions, just putting here what I think I know.
Add the setOnBufferingUpdateListener listener, and in this method you can know how many percent is buffered.
The above works for me for some streams, and don’t work for some other. I am still trying to figure out why.