public static final int MEDIA_ERROR_IO = -1004;
public static final int MEDIA_ERROR_MALFORMED = -1007;
public static final int MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK = 200;
public static final int MEDIA_ERROR_SERVER_DIED = 100;
public static final int MEDIA_ERROR_TIMED_OUT = -110;
public static final int MEDIA_ERROR_UNKNOWN = 1;
public static final int MEDIA_ERROR_UNSUPPORTED = -1010;
MediaPlayer 클래스 안에 상수로 위와 같이 정의 되어 있네요.
말씀하신 1은 UNKNOWN으로 정의 되어 있긴 한데
-1이랑 0은 없는데요.
혹시 몰라서 레퍼런스 사이트(https://developer.android.com/reference/android/media/MediaPlayer.OnErrorListener.html)도 긁어 놓겠습니다. 위의 코드값이랑 아래 extra 설명 참조해서 살펴보세요.
Public methods
onError
Added in API level 1
boolean onError (MediaPlayer mp,
int what,
int extra)
Called to indicate an error.
Parameters |
---|
mp | MediaPlayer: the MediaPlayer the error pertains to |
what | int: the type of error that has occurred: |
extra | int: an extra code, specific to the error. Typically implementation dependent. |
Returns |
---|
boolean | True if the method handled the error, false if it didn't. Returning false, or not having an OnErrorListener at all, will cause the OnCompletionListener to be called. |