First, I designed if touch, move 10000 msec position from clip top.
boolean isSeeking = false; @Override public boolean onTouchEvent(MotionEvent event) { switch(event.getAction()) { case MotionEvent.ACTION_DOWN: if (isSeeking == false) { isSeeking = true; _mediaplayer.seekTo(10000); } else { //Do nothing } break; default: break; } return super.onTouchEvent(event); }And... I had to catch seek complete event.
@Override public void onSeekComplete(MediaPlayer mp) { isSeeking = false; }Must register seek complete listener
_mediaplayer.setOnSeekCompleteListener(this);Second, I tryed preparedAsync(). call preparedAsync() and register prepared complete event
_mediaplayer.setOnPreparedListener(this); _mediaplayer.setOnSeekCompleteListener(this); _mediaplayer.prepareAsync();This is prepared completed process:
@Override public void onPrepared(MediaPlayer mp) { _mediaplayer.start(); Log.d("player", "start"); }My source code is here.
0 件のコメント:
コメントを投稿