From 9741be743c780d711be8549b2eff02c2ea9845e0 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Sun, 25 Jun 2023 14:18:40 +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=E5=99=A8=E6=8A=A5=E9=94=99=E6=97=B6=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E8=A7=82=E4=BC=97=E7=AB=AF=E7=9C=8B?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E4=B8=8B=E6=92=AD=E7=9B=B4=E6=92=AD=E9=97=B4?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/live/utils/LiveExoPlayerManager.java | 6 ++++++ .../java/com/yunbao/live/views/PortraitLiveManager.java | 1 + 2 files changed, 7 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 77acc0f12..3fb0791c9 100644 --- a/live/src/main/java/com/yunbao/live/utils/LiveExoPlayerManager.java +++ b/live/src/main/java/com/yunbao/live/utils/LiveExoPlayerManager.java @@ -19,6 +19,8 @@ import com.google.android.exoplayer2.analytics.AnalyticsListener; import com.google.android.exoplayer2.ui.AspectRatioFrameLayout; import com.google.android.exoplayer2.ui.StyledPlayerView; import com.google.android.exoplayer2.video.VideoSize; +import com.yunbao.common.utils.ToastUtil; +import com.yunbao.live.R; /** * 直播间播放器管理器 @@ -38,8 +40,10 @@ public class LiveExoPlayerManager { private final Handler handler; private static double log_buffer_time = 0, log_buffer_max_time; private String url = ""; + private Context mContext; public LiveExoPlayerManager(Context mContext) { + this.mContext = mContext; DefaultLoadControl control = new DefaultLoadControl.Builder() .setPrioritizeTimeOverSizeThresholds(false) .setBackBuffer(10_000, true) @@ -191,6 +195,7 @@ public class LiveExoPlayerManager { Player.Listener.super.onPlayerError(error); error.printStackTrace(); replay(); + ToastUtil.show(mContext.getString(R.string.net_error) + " :" + error.errorCode); } }); @@ -260,6 +265,7 @@ public class LiveExoPlayerManager { Player.Listener.super.onPlayerError(error); error.printStackTrace(); replay(); + ToastUtil.show(mContext.getString(R.string.net_error) + " :" + error.errorCode); } }); } diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index b805b5f1c..bcac77b9d 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -257,6 +257,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe public void run() { loading.setVisibility(View.GONE); enterRoomLeaveHandler.post(enterRoomLeaveRunnable); + ToastUtil.show(mContext.getString(R.string.net_error) + " :500" );//异常下播,等待加载时间过了后弹出 } };