MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK as doc says :
The video is streamed and its container is not valid for progressive
playback i.e the video's index (e.g moov atom) is not at the start of
the file.
The MediaPlayer often change to error state when playing video,and then prompt "can't play this video" dialog, so you have to handle these error via remembering the played time and replaying video after reset MediaPlayer engine.
You can implement OnErrorListener
in your code for handling this type of errors as:
private MediaPlayer.OnErrorListener mOnErrorListener = new MediaPlayer.OnErrorListener() {
public boolean onError(MediaPlayer mp, int what, int extra) {
switch (what) {
case MediaPlayer.MEDIA_ERROR_SERVER_DIED:
Toast.makeText(PlayerActivity.this, "MEDIA_ERROR_SERVER_DIED",
Toast.LENGTH_SHORT).show();
return true;
case MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK:
Toast.makeText(PlayerActivity.this,
"MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK",
Toast.LENGTH_SHORT).show();
break;
case MediaPlayer.MEDIA_ERROR_UNKNOWN:
Toast.makeText(PlayerActivity.this, "MEDIA_ERROR_UNKNOWN",
Toast.LENGTH_SHORT).show();
break;
}
setProgressContainer(true, getString(R.string.msg_handle_error));
int position=mVideoView.getCurrentPosition();
if(position>0){
mCurPosition=position;
}
mVideoView.setVideoPath(mCurrentMediaUrl,position);
return true;
}
};