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 8abbd82ab..d074070ee 100644 --- a/live/src/main/java/com/yunbao/live/utils/LiveExoPlayerManager.java +++ b/live/src/main/java/com/yunbao/live/utils/LiveExoPlayerManager.java @@ -40,9 +40,9 @@ public class LiveExoPlayerManager { public LiveExoPlayerManager(Context mContext) { DefaultLoadControl control = new DefaultLoadControl.Builder() .setPrioritizeTimeOverSizeThresholds(false) - .setBackBuffer(120_000, true) + .setBackBuffer(10_000, true) .setBufferDurationsMs(500, - 60_000, + 5_000, 150, 200) .build(); @@ -328,6 +328,7 @@ public class LiveExoPlayerManager { */ public void stop() { getNowPlayer().stop(); + clearUrl(); } /** @@ -355,9 +356,13 @@ public class LiveExoPlayerManager { * 释放播放器 */ public void release() { + Log.i(TAG, "release: 释放播放器"); player1.release(); player2.release(); } + public void clearUrl(){ + url=""; + } public String getUrl() { if (url == null) { diff --git a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java index eb5c6102c..271bdc723 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java @@ -302,6 +302,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { } if (mPlayer.isPlaying()) { mPlayer.stop(); + mPlayer.clearUrl(); } mPlayer.startUrl(url); purl = url;