From eaafcdd444ef3f6d33aae414168664daf6033ac3 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 11 Jan 2023 11:34:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=9E=E9=BA=A6=E4=B8=8B?= =?UTF-8?q?=E9=BA=A6=E6=97=B6=E4=BC=9A=E7=94=BB=E9=9D=A2=E5=8D=A1=E4=BD=8F?= =?UTF-8?q?=E7=9A=84=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 | 5 +++++ .../java/com/yunbao/live/views/LivePlayRyViewHolder.java | 4 ++-- 2 files changed, 7 insertions(+), 2 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 1bd62a09b..c23774c61 100644 --- a/live/src/main/java/com/yunbao/live/utils/LiveExoPlayerManager.java +++ b/live/src/main/java/com/yunbao/live/utils/LiveExoPlayerManager.java @@ -338,6 +338,11 @@ public class LiveExoPlayerManager { public void play() { getNowPlayer().play(); } + public void replay(){ + String tmp=url; + url=null; + startUrl(tmp); + } public void clearFrame() { mainView.setKeepContentOnPlayerReset(false); 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 22a847970..7459fd7e0 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java @@ -263,8 +263,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { if (!mPlayer.isPlaying()) { new Handler(Looper.getMainLooper()) .postDelayed(() -> { - mPlayer.stop(); - mPlayer.play(); + mPlayer.replay(); // ToastUtil.show("强制播放" + val); }, 100); } @@ -1041,6 +1040,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { "timestampNs:" + videoFrame.getTimestampNs() + "\n" + "分辨率:" + videoFrame.getBuffer().getHeight() + "x" + videoFrame.getBuffer().getWidth() + "\n" + "当前时间:" + new SimpleDateFormat("HH:mm:ss", Locale.CHINA).format(new Date()) + "\n"; + System.out.println("debugText = " + debugText); new Handler(Looper.getMainLooper()).post(() -> { debugView.setText(debugText);