Merge branch 'refs/heads/v6.8.1' into 6.8.2

This commit is contained in:
老皮
2024-09-27 10:09:00 +08:00
7 changed files with 105 additions and 18 deletions

View File

@@ -26,5 +26,5 @@ public interface CheckLiveCallBack {
*
* @param error
*/
void onError(String error);
void onError(String error,int code);
}

View File

@@ -426,12 +426,12 @@ public class LiveNetManager {
}
} else {
if (callBack != null) {
callBack.onError(listResponseModel.getData().getMsg());
callBack.onError(listResponseModel.getData().getMsg(), listResponseModel.getData().getCode());
}
}
} else {
if (callBack != null) {
callBack.onError(listResponseModel.getData().getMsg());
callBack.onError(listResponseModel.getData().getMsg(), listResponseModel.getData().getCode());
}
}
}
@@ -440,7 +440,7 @@ public class LiveNetManager {
public void accept(Throwable throwable) throws Exception {
Log.e("异常", "checkLive: ", throwable);
if (callBack != null) {
callBack.onError(throwable.getMessage());
callBack.onError(throwable.getMessage(), -1008611);
}
}
}).isDisposed();

View File

@@ -43,8 +43,9 @@ public class LiveRoomCheckLivePresenter {
* @param context 上下文
* @param liveUid 直播间ID
* @param stream
* @param isPk 是否是pk时点击头像打开弹窗后跳转来的
*/
public LiveRoomCheckLivePresenter(Context context, String liveUid, String stream, NewActionListener actionListener) {
public LiveRoomCheckLivePresenter(Context context, String liveUid, String stream, NewActionListener actionListener,boolean... isPk) {
mContext = context;
LiveNetManager.get(context)
.checkLive(liveUid, stream, new CheckLiveCallBack() {
@@ -106,9 +107,14 @@ public class LiveRoomCheckLivePresenter {
}
@Override
public void onError(String error) {
Log.e("直播间异常", "onError: " + error);
Bus.get().post(new LiveErrorEvent());
public void onError(String error,int code) {
Log.e("直播间异常", "onError: " + error + " code = " + code);
if (code == 1004 && isPk != null && isPk.length > 0 && isPk[0]) {
// 1004 为用户被踢过,不能进入直播间但是不能随机再进入别的直播间
Log.e("直播间异常", "onError: " + error + " code = " + code);
}else {
Bus.get().post(new LiveErrorEvent());
}
ToastUtil.show(error);
}
});