Confirm MediaPlayer automatic retry on streaming HTTP error

by Skyler » Fri, 20 May 2011 09:34:08 GMT

Sponsored Links
 Hi all,
I have an app which streams mp3s from the web, proxied through a local HTTP 
server. At times, this local proxy server returns an HTTP error. It seems 
that upon receiving this error during the prepare state, the MediaPlayer 
makes one more attempt to stream, sending another request to the URL 
specified in setDataSource().

thread, I can see that after sending an HTTP error response, another request 
for the same URL is made. Can someone confirm this behavior? I'm seeing this 
from the emulator running a 1.6 AVD.

Additionally, can I disable this automatic retry? Is there a specific HTTP 
error code that I can send that will prevent this retry?



Other Threads

1. Application that loops every minute - how to efficiently do it

Does Android have a special way to loop an application every 1 minute?
Or do you know of any applications (with source) that I could look at?

Apparently if I use Thread.sleep(1000*60); the application may time
out on me and need me to click a wait button - I just want it to keep
looping forever. Apparently the when you sleep() a thread it stops
running for the time given.

I'm using it to ensure that my internet connection isn't ever open for
more than a minute something like this:

while (true) {
    if (getConnectionOpenTime()>1minute) {

The connection gets re-opened elsewhere so this needs to keep looping.


2. Buffering Background Image - Graphics Advice Sought

I sorted this out.



3. Alert dialog in Android-SDK-1.1-Release 1

4. Home screen customization WRT certification

5. libhardware_legacy and flashlight.c

6. Performance: pre-instantiate activities on app launch? Good practice or not?

7. Some question about OrientationListener and the way of sensor( sensorlistener, sensormanager..... ) init