|
|
|
|
@ -134,6 +134,7 @@ public class VideoActivity extends BaseActivity implements CustomKeyDownVod.List |
|
|
|
|
private List<String> mBroken; |
|
|
|
|
private History mHistory; |
|
|
|
|
private Players mPlayers; |
|
|
|
|
private boolean background; |
|
|
|
|
private boolean fullscreen; |
|
|
|
|
private boolean initTrack; |
|
|
|
|
private boolean initAuto; |
|
|
|
|
@ -298,6 +299,7 @@ public class VideoActivity extends BaseActivity implements CustomKeyDownVod.List |
|
|
|
|
mR1 = this::hideControl; |
|
|
|
|
mR2 = this::setTraffic; |
|
|
|
|
mR3 = this::showEmpty; |
|
|
|
|
setBackground(false); |
|
|
|
|
setRecyclerView(); |
|
|
|
|
setVideoView(); |
|
|
|
|
setDanmuView(); |
|
|
|
|
@ -1118,6 +1120,7 @@ public class VideoActivity extends BaseActivity implements CustomKeyDownVod.List |
|
|
|
|
|
|
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN) |
|
|
|
|
public void onActionEvent(ActionEvent event) { |
|
|
|
|
if (isBackground()) return; |
|
|
|
|
if (ActionEvent.PLAY.equals(event.getAction()) || ActionEvent.PAUSE.equals(event.getAction())) { |
|
|
|
|
onKeyCenter(); |
|
|
|
|
} else if (ActionEvent.NEXT.equals(event.getAction())) { |
|
|
|
|
@ -1131,6 +1134,7 @@ public class VideoActivity extends BaseActivity implements CustomKeyDownVod.List |
|
|
|
|
|
|
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN) |
|
|
|
|
public void onRefreshEvent(RefreshEvent event) { |
|
|
|
|
if (isBackground()) return; |
|
|
|
|
if (event.getType() == RefreshEvent.Type.DETAIL) getDetail(); |
|
|
|
|
else if (event.getType() == RefreshEvent.Type.PLAYER) onRefresh(); |
|
|
|
|
else if (event.getType() == RefreshEvent.Type.DANMAKU) checkDanmu(event.getPath()); |
|
|
|
|
@ -1139,6 +1143,7 @@ public class VideoActivity extends BaseActivity implements CustomKeyDownVod.List |
|
|
|
|
|
|
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN) |
|
|
|
|
public void onPlayerEvent(PlayerEvent event) { |
|
|
|
|
if (isBackground()) return; |
|
|
|
|
switch (event.getState()) { |
|
|
|
|
case 0: |
|
|
|
|
setPosition(); |
|
|
|
|
@ -1208,6 +1213,7 @@ public class VideoActivity extends BaseActivity implements CustomKeyDownVod.List |
|
|
|
|
|
|
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN) |
|
|
|
|
public void onErrorEvent(ErrorEvent event) { |
|
|
|
|
if (isBackground()) return; |
|
|
|
|
if (mPlayers.addRetry() > event.getRetry()) checkError(event); |
|
|
|
|
else onRefresh(); |
|
|
|
|
} |
|
|
|
|
@ -1359,6 +1365,14 @@ public class VideoActivity extends BaseActivity implements CustomKeyDownVod.List |
|
|
|
|
hideCenter(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public boolean isBackground() { |
|
|
|
|
return background; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setBackground(boolean background) { |
|
|
|
|
this.background = background; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean isFullscreen() { |
|
|
|
|
return fullscreen; |
|
|
|
|
} |
|
|
|
|
@ -1545,6 +1559,7 @@ public class VideoActivity extends BaseActivity implements CustomKeyDownVod.List |
|
|
|
|
@Override |
|
|
|
|
protected void onResume() { |
|
|
|
|
super.onResume(); |
|
|
|
|
setBackground(false); |
|
|
|
|
mClock.start(); |
|
|
|
|
onPlay(); |
|
|
|
|
} |
|
|
|
|
@ -1552,6 +1567,7 @@ public class VideoActivity extends BaseActivity implements CustomKeyDownVod.List |
|
|
|
|
@Override |
|
|
|
|
protected void onPause() { |
|
|
|
|
super.onPause(); |
|
|
|
|
setBackground(true); |
|
|
|
|
onPaused(false); |
|
|
|
|
mClock.stop(); |
|
|
|
|
} |
|
|
|
|
|