Invoke the OnErrorListener callback when MediaPlayer.setDataSource() throws.

Fixes http://b/issue?id=2156505
This commit is contained in:
Andrei Popescu
2009-09-30 14:54:55 +01:00
parent b386a86c1c
commit 020d2e3453

View File

@ -222,11 +222,13 @@ public class VideoView extends SurfaceView implements MediaPlayerControl {
Log.w(TAG, "Unable to open content: " + mUri, ex);
mCurrentState = STATE_ERROR;
mTargetState = STATE_ERROR;
mErrorListener.onError(mMediaPlayer, MediaPlayer.MEDIA_ERROR_UNKNOWN, 0);
return;
} catch (IllegalArgumentException ex) {
Log.w(TAG, "Unable to open content: " + mUri, ex);
mCurrentState = STATE_ERROR;
mTargetState = STATE_ERROR;
mErrorListener.onError(mMediaPlayer, MediaPlayer.MEDIA_ERROR_UNKNOWN, 0);
return;
}
}