public void stopPlay() { if (mCurRecordInfo == null) { return; } mMediaPlayer.stop(); mMediaPlayer.reset(); mCurRecordInfo.play = false; }
public void startPlay() { if (mCurRecordInfo == null) { return; } prepareRecorder(); mMediaPlayer.start(); mCurRecordInfo.play = true; }
@Override public void onCompletion(MediaPlayer arg0) { if (mCurRecordInfo == null) { return; } mCurRecordInfo.play = false; mCurRecordInfo = null; mMediaPlayer.reset(); if (mOnCompletionListener != null) { mOnCompletionListener.onCompletion(); } }
@Override public boolean onError(MediaPlayer arg0, int arg1, int arg2) { if (mCurRecordInfo == null) { return false; } mCurRecordInfo.play = false; mCurRecordInfo = null; mMediaPlayer.reset(); if (mOnCompletionListener != null) { mOnCompletionListener.onCompletion(); } return false; }