Fix play pause bug

pull/617/head
FongMi 3 months ago
parent 74d6ac35f4
commit d92e809ff7
  1. 6
      app/src/leanback/java/com/fongmi/android/tv/ui/activity/CastActivity.java
  2. 6
      app/src/leanback/java/com/fongmi/android/tv/ui/activity/LiveActivity.java
  3. 12
      app/src/leanback/java/com/fongmi/android/tv/ui/activity/VideoActivity.java
  4. 6
      app/src/mobile/java/com/fongmi/android/tv/ui/activity/LiveActivity.java
  5. 12
      app/src/mobile/java/com/fongmi/android/tv/ui/activity/VideoActivity.java

@ -286,8 +286,10 @@ public class CastActivity extends BaseActivity implements CustomKeyDownVod.Liste
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
public void onActionEvent(ActionEvent event) { public void onActionEvent(ActionEvent event) {
if (ActionEvent.PLAY.equals(event.getAction()) || ActionEvent.PAUSE.equals(event.getAction())) { if (ActionEvent.PLAY.equals(event.getAction())) {
onKeyCenter(); onPlay();
} else if (ActionEvent.PAUSE.equals(event.getAction())) {
onPaused();
} else if (ActionEvent.STOP.equals(event.getAction())) { } else if (ActionEvent.STOP.equals(event.getAction())) {
finish(); finish();
} }

@ -746,8 +746,10 @@ public class LiveActivity extends BaseActivity implements GroupPresenter.OnClick
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
public void onActionEvent(ActionEvent event) { public void onActionEvent(ActionEvent event) {
if (ActionEvent.PLAY.equals(event.getAction()) || ActionEvent.PAUSE.equals(event.getAction())) { if (ActionEvent.PLAY.equals(event.getAction())) {
checkPlay(); onPlay();
} else if (ActionEvent.PAUSE.equals(event.getAction())) {
onPaused();
} else if (ActionEvent.NEXT.equals(event.getAction())) { } else if (ActionEvent.NEXT.equals(event.getAction())) {
nextChannel(); nextChannel();
} else if (ActionEvent.PREV.equals(event.getAction())) { } else if (ActionEvent.PREV.equals(event.getAction())) {

@ -1042,14 +1042,16 @@ public class VideoActivity extends BaseActivity implements CustomKeyDownVod.List
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
public void onActionEvent(ActionEvent event) { public void onActionEvent(ActionEvent event) {
if (isRedirect()) return; if (isRedirect()) return;
if (ActionEvent.PLAY.equals(event.getAction()) || ActionEvent.PAUSE.equals(event.getAction())) { if (ActionEvent.PLAY.equals(event.getAction())) {
onKeyCenter(); onPlay();
} else if (ActionEvent.PAUSE.equals(event.getAction())) {
onPaused();
} else if (ActionEvent.NEXT.equals(event.getAction())) { } else if (ActionEvent.NEXT.equals(event.getAction())) {
mBinding.control.next.performClick(); checkNext();
} else if (ActionEvent.PREV.equals(event.getAction())) { } else if (ActionEvent.PREV.equals(event.getAction())) {
mBinding.control.prev.performClick(); checkPrev();
} else if (ActionEvent.LOOP.equals(event.getAction())) { } else if (ActionEvent.LOOP.equals(event.getAction())) {
mBinding.control.loop.performClick(); onLoop();
} else if (ActionEvent.REPLAY.equals(event.getAction())) { } else if (ActionEvent.REPLAY.equals(event.getAction())) {
onReset(true); onReset(true);
} else if (ActionEvent.STOP.equals(event.getAction())) { } else if (ActionEvent.STOP.equals(event.getAction())) {

@ -783,8 +783,10 @@ public class LiveActivity extends BaseActivity implements CustomKeyDown.Listener
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
public void onActionEvent(ActionEvent event) { public void onActionEvent(ActionEvent event) {
if (ActionEvent.PLAY.equals(event.getAction()) || ActionEvent.PAUSE.equals(event.getAction())) { if (ActionEvent.PLAY.equals(event.getAction())) {
checkPlay(); onPlay();
} else if (ActionEvent.PAUSE.equals(event.getAction())) {
onPaused();
} else if (ActionEvent.NEXT.equals(event.getAction())) { } else if (ActionEvent.NEXT.equals(event.getAction())) {
nextChannel(); nextChannel();
} else if (ActionEvent.PREV.equals(event.getAction())) { } else if (ActionEvent.PREV.equals(event.getAction())) {

@ -1143,14 +1143,16 @@ public class VideoActivity extends BaseActivity implements Clock.Callback, Custo
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
public void onActionEvent(ActionEvent event) { public void onActionEvent(ActionEvent event) {
if (isRedirect()) return; if (isRedirect()) return;
if (ActionEvent.PLAY.equals(event.getAction()) || ActionEvent.PAUSE.equals(event.getAction())) { if (ActionEvent.PLAY.equals(event.getAction())) {
mBinding.control.play.performClick(); onPlay();
} else if (ActionEvent.PAUSE.equals(event.getAction())) {
onPaused();
} else if (ActionEvent.NEXT.equals(event.getAction())) { } else if (ActionEvent.NEXT.equals(event.getAction())) {
mBinding.control.next.performClick(); checkNext();
} else if (ActionEvent.PREV.equals(event.getAction())) { } else if (ActionEvent.PREV.equals(event.getAction())) {
mBinding.control.prev.performClick(); checkPrev();
} else if (ActionEvent.LOOP.equals(event.getAction())) { } else if (ActionEvent.LOOP.equals(event.getAction())) {
mBinding.control.action.loop.performClick(); onLoop();
} else if (ActionEvent.REPLAY.equals(event.getAction())) { } else if (ActionEvent.REPLAY.equals(event.getAction())) {
onReset(true); onReset(true);
} else if (ActionEvent.AUDIO.equals(event.getAction())) { } else if (ActionEvent.AUDIO.equals(event.getAction())) {

Loading…
Cancel
Save