diff --git a/live/src/main/java/com/yunbao/live/utils/LiveExoPlayerManager.java b/live/src/main/java/com/yunbao/live/utils/LiveExoPlayerManager.java index 59292afa7..8abbd82ab 100644 --- a/live/src/main/java/com/yunbao/live/utils/LiveExoPlayerManager.java +++ b/live/src/main/java/com/yunbao/live/utils/LiveExoPlayerManager.java @@ -46,8 +46,8 @@ public class LiveExoPlayerManager { 150, 200) .build(); - player1 = new ExoPlayer.Builder(mContext).setLoadControl(control).build(); - player2 = new ExoPlayer.Builder(mContext).setLoadControl(control).build(); + player1 = new ExoPlayer.Builder(mContext).build(); + player2 = new ExoPlayer.Builder(mContext).build(); player1.setVideoScalingMode(C.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING); player2.setVideoScalingMode(C.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING); @@ -115,6 +115,7 @@ public class LiveExoPlayerManager { public void run() { playBufferIndex = 0; listener.onPlaybackStateChanged(Player.STATE_BUFFERING); + replay(); } }; @@ -134,7 +135,7 @@ public class LiveExoPlayerManager { } else if (playbackState == Player.STATE_BUFFERING && status == MODEL_PLAY1 && !isSwitchUrl) { if (listener != null) { if (playBufferIndex++ == 0) { - handler.postDelayed(buffRunnable, 1000); + handler.postDelayed(buffRunnable, 2000); } } } @@ -205,7 +206,7 @@ public class LiveExoPlayerManager { } else if (playbackState == Player.STATE_BUFFERING && status == MODEL_PLAY2 && !isSwitchUrl) { if (listener != null) { if (playBufferIndex++ == 0) { - handler.postDelayed(buffRunnable, 1000); + handler.postDelayed(buffRunnable, 2000); } } } @@ -337,6 +338,7 @@ public class LiveExoPlayerManager { } public void replay() { + Log.i(TAG, "replay: 重载播放"); String tmp = url; url = null; startUrl(tmp);