I have a problem with http streams over the android mediaplayer. I have written my own http server task which sends wav audio files to the mediaplayer. Everything works perfect with my galaxy s3 galaxy note2 and a chinese tablet but now I have got a ASUS K109 tablet and with this device my server doesn't work.
My start code looks like this:
mPlayer.reset();
mPlayer.setDataSource(uri.toString());
mPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mediaPlayer) {
mPlayer.start();
}
});
mPlayer.prepareAsync();
The first call work great but if I want to start a new file while the first is running the "onPrepared()
was never called.
I figured out the with my other devices the reset()
method closes the socket connection therefore my server throws an error while sending the data and if that occures the server will stop sending data and waits for a new connection. With the Asus tablet the connection is not closed and therefore the server stays inside the send loop and does not wait for a new connection.
I have also tried to stop()
and to release()
the mediaplayer but this also doesn't help.
Is this a known bug with the Asus tableb or the Android 5.0.1 version on it?
Have I missed something?
Thanks