I've got a little problem with MediaPlayer. Problem appears on Android 4.0.3 - 4.0.4. Whats happening is that my onPrepare() method is not fired at all on those two versions. Tested on 4.3 and 4.4 and no problem at all.
I have no idea what might be the reason for it to not work. So any ideas, thoughts etc are welcome.
PLAY CODE:
try {
if (!player.isPlaying()) {
player.reset();
player.setOnPreparedListener(this);
player.setOnCompletionListener(mFragment);
player.setDataSource(String.valueOf(tmpUri));
player.prepareAsync();
}
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalStateException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
start() is in on prepare method.
Logcat error:
ERROR/MediaPlayer(10830): Error (1,-2147483648)
ERROR/MediaPlayer(10830): mOnErrorListener is null. Failed to send MEDIA_ERROR message.