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);