I'm streaming audio files from server. I'm handling the situation when internet connection is lost and the player gets to the end of the buffered part (there is some part of the song which is not buffered). I've implemented OnErrorListener, OnInfoListener and OnCompletionListener. This is the onInfo method
@Override
public boolean onInfo(MediaPlayer mp, int what, int extra) {
if (what == MediaPlayer.MEDIA_INFO_BUFFERING_START && !Utils.isInternetConected()) {
//handle situation
}
return true;
}
On newer devices this is called just before reaching the end of the buffered part.But on older devices neither onError nor onInfo is called reaching end of the buffered part. only onComplete() is called. On older devices I understand 2.3.3 - 2.3.7(I'v tested it on 3 devices).The MEDIA_INFO_BUFFERING_START is introduced in API level 9 , my devices are API 9 or 10. Can someone tell me why onInfo or onError is not called on older devices and onCompletion is automatically called ? Thanks in advance