pull/123/head
FongMi 3 years ago
parent 08f2c49114
commit 8ddac062a3
  1. 2
      app/src/leanback/java/com/fongmi/android/tv/ui/activity/DetailActivity.java
  2. 10
      app/src/main/java/com/fongmi/android/tv/event/ErrorEvent.java
  3. 4
      app/src/main/java/com/fongmi/android/tv/player/Players.java

@ -818,7 +818,7 @@ public class DetailActivity extends BaseActivity implements CustomKeyDownVod.Lis
private void checkError(ErrorEvent event) {
if (event.isParse() && mParseAdapter.size() > 0) checkParse();
else if (event.isUrl()) onNext();
else if (event.isAds()) onNext();
else checkFlag();
}

@ -14,6 +14,10 @@ public class ErrorEvent {
EventBus.getDefault().post(new ErrorEvent(Type.URL, false));
}
public static void ads() {
EventBus.getDefault().post(new ErrorEvent(Type.ADS, false));
}
public static void parse() {
EventBus.getDefault().post(new ErrorEvent(Type.PARSE, false));
}
@ -47,8 +51,8 @@ public class ErrorEvent {
return retry;
}
public boolean isUrl() {
return getType() == Type.URL;
public boolean isAds() {
return getType() == Type.ADS;
}
public boolean isParse() {
@ -60,6 +64,6 @@ public class ErrorEvent {
}
public enum Type {
URL, PARSE, FORMAT, TIMEOUT
ADS, URL, PARSE, FORMAT, TIMEOUT
}
}

@ -268,8 +268,10 @@ public class Players implements Player.Listener, IMediaPlayer.OnInfoListener, IM
}
public void start(Result result, boolean useParse) {
if (result.getUrl().isEmpty() || isAds(result.getUrl())) {
if (result.getUrl().isEmpty()) {
ErrorEvent.url();
} else if (isAds(result.getUrl())) {
ErrorEvent.ads();
} else if (result.getParse(1) == 1 || result.getJx() == 1) {
stopParse();
parseTask = ParseTask.create(this).run(result, useParse);

Loading…
Cancel
Save