MediaPlayer의 Create에 대한 실제 구현을 보시면 아래와 같이 prepare를 호출 합니다.
따라서 prepareAsync 를 호출하면, prepare, prepareAsync가 각각 호출 되서
오류가 날 수 밖에 없습니다.
Create를 사용하지 말고, 직접 생성하여 호출하는 방식으로 사용하시던지. prepareAsync 기능을 빼시는게 좋을 듯 합니다.
public static MediaPlayer create(Context context, Uri uri, SurfaceHolder holder,
AudioAttributes audioAttributes, int audioSessionId) {
try {
MediaPlayer mp = new MediaPlayer();
final AudioAttributes aa = audioAttributes != null ? audioAttributes :
new AudioAttributes.Builder().build();
mp.setAudioAttributes(aa);
mp.setAudioSessionId(audioSessionId);
mp.setDataSource(context, uri);
if (holder != null) {
mp.setDisplay(holder);
}
mp.prepare();
return mp;
} catch (IOException ex) {
Log.d(TAG, "create failed:", ex);
// fall through
} catch (IllegalArgumentException ex) {
Log.d(TAG, "create failed:", ex);
// fall through
} catch (SecurityException ex) {
Log.d(TAG, "create failed:", ex);
// fall through
}
return null;
}