Confirm MediaPlayer automatic attempt with streaming HTTP error

I originally sent this question to the Android developers a few days ago by the Google group , but have not yet received an answer. Maybe someone from Qaru can help?

I have an application that broadcasts mp3 files from the Internet proxied through a local HTTP server. Sometimes this local proxy returns an HTTP error. It seems that after receiving this error during preparation, MediaPlayer makes another stream attempt, sending another request to the URL specified in setDataSource ().

From the stream, I call MediaPlayer.prepare () once. But from the proxy stream, I see that after sending the HTTP error response, another request is created for the same URL. Can someone confirm this behavior? I see this from an emulator with 1.6 AVD.

Can I turn off this automatic attempt? Is there a specific HTTP error code I can send that will prevent a replay?

Thank!

+3
source share

All Articles