From 9f9c02b7e78e734fadbb574bcc828b96fc2c8db2 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Tue, 10 Jan 2023 17:59:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=8D=E5=A4=8D=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=88=86=E8=BE=A8=E7=8E=87=E4=BC=9A=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/live/utils/LiveExoPlayerManager.java | 6 ++++++ 1 file changed, 6 insertions(+) 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 dc2cd8c05..1bd62a09b 100644 --- a/live/src/main/java/com/yunbao/live/utils/LiveExoPlayerManager.java +++ b/live/src/main/java/com/yunbao/live/utils/LiveExoPlayerManager.java @@ -157,6 +157,9 @@ public class LiveExoPlayerManager { mainView.setPlayer(player1); status = MODEL_PLAY1; isSwitchUrl = false; + if(getNextPlayer().isPlaying()){ + getNextPlayer().stop(); + } if (listener != null) { listener.onIsPlayingChanged(true); } @@ -224,6 +227,9 @@ public class LiveExoPlayerManager { //ToastUtil.show(String.format(Locale.CHINA, "从加载到播放 = %.3f,最大耗时 = %.3f", tmp, log_buffer_max_time)); log_buffer_time = -1; status = MODEL_PLAY2; + if(getNextPlayer().isPlaying()){ + getNextPlayer().stop(); + } isSwitchUrl = false; if (listener != null) { listener.onIsPlayingChanged(true);