From 5f2dda021a5a21e666837cd18a8b1dec922aede5 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 11 Jan 2023 18:06:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=9B=B4=E6=92=AD=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E7=BC=93=E5=86=B2=E8=B6=85=E8=BF=872=E7=A7=92?= =?UTF-8?q?=E5=B0=B1=E5=88=B7=E6=96=B0=E6=92=AD=E6=94=BE=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/live/utils/LiveExoPlayerManager.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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);