pull/564/head
okjack 1 year ago
parent 38445c8453
commit 61ed2a356b
  1. 7
      app/src/main/java/com/fongmi/android/tv/player/Players.java

@ -91,7 +91,6 @@ public class Players implements Player.Listener, IMediaPlayer.Listener, ParseCal
private int decode;
private int count;
private int player;
private int error;
private int retry;
public static Players create(Activity activity) {
@ -237,7 +236,6 @@ public class Players implements Player.Listener, IMediaPlayer.Listener, ParseCal
removeTimeoutCheck();
stopParse();
count = 0;
error = 0;
retry = 0;
}
@ -553,9 +551,9 @@ public class Players implements Player.Listener, IMediaPlayer.Listener, ParseCal
if (isIjk() && ijkPlayer != null) ijkPlayer.setMediaSource(IjkUtil.getSource(this.headers = checkUa(headers), this.url = url), position);
if (isExo() && exoPlayer != null) exoPlayer.setMediaItem(ExoUtil.getMediaItem(this.headers = checkUa(headers), UrlUtil.uri(this.url = url), this.format = format, this.drm = drm, checkSub(this.subs = subs), decode), position);
if (isExo() && exoPlayer != null) exoPlayer.prepare();
Logger.t(TAG).d(error + "," + url);
App.post(runnable, timeout);
PlayerEvent.prepare();
Logger.t(TAG).d(url);
}
private void removeTimeoutCheck() {
@ -711,7 +709,8 @@ public class Players implements Player.Listener, IMediaPlayer.Listener, ParseCal
@Override
public void onPlayerError(@NonNull PlaybackException error) {
setPlaybackState(PlaybackStateCompat.STATE_ERROR);
ErrorEvent.url(ExoUtil.getRetry(this.error = error.errorCode), error.errorCode);
Logger.t(TAG).e(error.errorCode + "," + url);
ErrorEvent.url(ExoUtil.getRetry(error.errorCode), error.errorCode);
}
@Override

Loading…
Cancel
Save