提交 132ec911 编写于 作者: J Javan.Eu 提交者: Zhang Rui

add exact seek video

Let ijkplayer can seek to wherever user want to see.
Signed-off-by: NZhang Rui <bbcallen@gmail.com>
上级 c34a6091
......@@ -474,6 +474,7 @@ public class MediaController extends FrameLayout {
updatePausePlay();
}
private Runnable lastRunnable;
private OnSeekBarChangeListener mSeekListener = new OnSeekBarChangeListener() {
public void onStartTrackingTouch(SeekBar bar) {
mDragging = true;
......@@ -492,10 +493,18 @@ public class MediaController extends FrameLayout {
if (!fromuser)
return;
long newposition = (mDuration * progress) / 1000;
final long newposition = (mDuration * progress) / 1000;
String time = generateTime(newposition);
if (mInstantSeeking)
mPlayer.seekTo(newposition);
if (mInstantSeeking) {
mHandler.removeCallbacks(lastRunnable);
lastRunnable = new Runnable() {
@Override
public void run() {
mPlayer.seekTo(newposition);
}
};
mHandler.postDelayed(lastRunnable, 200);
}
if (mInfoView != null)
mInfoView.setText(time);
if (mCurrentTime != null)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册