pull/171/head
FongMi 3 years ago
parent b7ffd5f352
commit c24475b12e
  1. 7
      app/src/main/java/com/fongmi/android/tv/App.java
  2. 2
      app/src/main/java/com/fongmi/android/tv/player/Players.java

@ -36,13 +36,12 @@ public class App extends Application {
private static App instance;
private Activity activity;
private final Gson gson;
private Looper looper;
private boolean hook;
public App() {
instance = this;
executor = Executors.newFixedThreadPool(Constant.THREAD_POOL);
handler = HandlerCompat.createAsync(looper = Looper.getMainLooper());
handler = HandlerCompat.createAsync(Looper.getMainLooper());
gson = new Gson();
}
@ -54,10 +53,6 @@ public class App extends Application {
return get().gson;
}
public static Looper looper() {
return get().looper;
}
public static Activity activity() {
return get().activity;
}

@ -121,7 +121,7 @@ public class Players implements Player.Listener, IMediaPlayer.Listener, Analytic
}
private void setupExo(PlayerView view) {
exoPlayer = new ExoPlayer.Builder(App.get()).setLooper(App.looper()).setLoadControl(ExoUtil.buildLoadControl()).setRenderersFactory(ExoUtil.buildRenderersFactory()).setTrackSelector(ExoUtil.buildTrackSelector()).build();
exoPlayer = new ExoPlayer.Builder(App.get()).setLoadControl(ExoUtil.buildLoadControl()).setRenderersFactory(ExoUtil.buildRenderersFactory()).setTrackSelector(ExoUtil.buildTrackSelector()).build();
exoPlayer.setAudioAttributes(AudioAttributes.DEFAULT, true);
exoPlayer.addAnalyticsListener(new EventLogger());
exoPlayer.addAnalyticsListener(this);

Loading…
Cancel
Save