pull/21/head
21561 3 years ago
parent c856e5d900
commit 8071a2f976
  1. 8
      app/src/main/java/com/github/tvbox/osc/player/controller/VodController.java
  2. 2
      app/src/main/java/com/github/tvbox/osc/ui/activity/DetailActivity.java

@ -103,7 +103,7 @@ public class VodController extends BaseController {
Handler myHandle; Handler myHandle;
Runnable myRunnable; Runnable myRunnable;
int myHandleSeconds = 5000;//闲置多少毫秒秒关闭底栏 默认5 int myHandleSeconds = 6000;//闲置多少毫秒秒关闭底栏 默认6
@Override @Override
protected void initView() { protected void initView() {
@ -179,6 +179,8 @@ public class VodController extends BaseController {
@Override @Override
public void onStopTrackingTouch(SeekBar seekBar) { public void onStopTrackingTouch(SeekBar seekBar) {
myHandle.removeCallbacks(myRunnable);
myHandle.postDelayed(myRunnable, myHandleSeconds);
long duration = mControlWrapper.getDuration(); long duration = mControlWrapper.getDuration();
long newPosition = (duration * seekBar.getProgress()) / seekBar.getMax(); long newPosition = (duration * seekBar.getProgress()) / seekBar.getMax();
mControlWrapper.seekTo((int) newPosition); mControlWrapper.seekTo((int) newPosition);
@ -449,6 +451,7 @@ public class VodController extends BaseController {
@Override @Override
protected void setProgress(int duration, int position) { protected void setProgress(int duration, int position) {
if (mIsDragging) { if (mIsDragging) {
return; return;
} }
@ -570,10 +573,12 @@ public class VodController extends BaseController {
@Override @Override
public boolean onKeyEvent(KeyEvent event) { public boolean onKeyEvent(KeyEvent event) {
myHandle.removeCallbacks(myRunnable);
if (super.onKeyEvent(event)) { if (super.onKeyEvent(event)) {
return true; return true;
} }
if (isBottomVisible()) { if (isBottomVisible()) {
myHandle.postDelayed(myRunnable, myHandleSeconds);
return super.dispatchKeyEvent(event); return super.dispatchKeyEvent(event);
} }
boolean isInPlayback = isInPlaybackState(); boolean isInPlayback = isInPlaybackState();
@ -592,7 +597,6 @@ public class VodController extends BaseController {
} }
// } else if (keyCode == KeyEvent.KEYCODE_DPAD_UP) { // 闲置开启计时关闭透明底栏 // } else if (keyCode == KeyEvent.KEYCODE_DPAD_UP) { // 闲置开启计时关闭透明底栏
} else if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN || keyCode == KeyEvent.KEYCODE_DPAD_UP) { } else if (keyCode == KeyEvent.KEYCODE_DPAD_DOWN || keyCode == KeyEvent.KEYCODE_DPAD_UP) {
myHandle.removeCallbacks(myRunnable);
if (!isBottomVisible()) { if (!isBottomVisible()) {
showBottom(); showBottom();
myHandle.postDelayed(myRunnable, myHandleSeconds); myHandle.postDelayed(myRunnable, myHandleSeconds);

@ -260,7 +260,7 @@ public class DetailActivity extends BaseActivity {
@Override @Override
public void onItemPreSelected(TvRecyclerView parent, View itemView, int position) { public void onItemPreSelected(TvRecyclerView parent, View itemView, int position) {
seriesSelect = false;
} }
@Override @Override

Loading…
Cancel
Save