关播时间问题

This commit is contained in:
18401019693 2022-12-01 18:45:03 +08:00
parent 3b1c5ac1ec
commit ed2879e263

View File

@ -27,8 +27,6 @@ import com.blankj.utilcode.util.GsonUtils;
import com.lzf.easyfloat.EasyFloat; import com.lzf.easyfloat.EasyFloat;
import com.lzf.easyfloat.permission.PermissionUtils; import com.lzf.easyfloat.permission.PermissionUtils;
import com.lzf.easyfloat.utils.LifecycleUtils; import com.lzf.easyfloat.utils.LifecycleUtils;
import com.tencent.imsdk.v2.V2TIMCallback;
import com.tencent.imsdk.v2.V2TIMManager;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext; import com.yunbao.common.CommonAppContext;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
@ -139,6 +137,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
//观众与主播连麦逻辑 //观众与主播连麦逻辑
private LiveLinkMicPresenter mLiveLinkMicPresenter; private LiveLinkMicPresenter mLiveLinkMicPresenter;
private LiveBean mLiveBean; private LiveBean mLiveBean;
//sdk类型 0金山 1腾讯 //sdk类型 0金山 1腾讯
private int mLiveSDK; private int mLiveSDK;
//主播与主播连麦逻辑 //主播与主播连麦逻辑
@ -186,6 +185,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
private View loading; private View loading;
private int landscape; private int landscape;
private String leaveStream = "", leaveGroupId = "";
public PortraitLiveManager setQuitF(boolean quitF) { public PortraitLiveManager setQuitF(boolean quitF) {
isQuitF = quitF; isQuitF = quitF;
@ -343,12 +343,17 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
.enterRoomNew(mLiveBean.getStream(), mLiveBean.getUid(), mLiveBean.getCity(), new com.yunbao.common.http.base.HttpCallback<EnterRoomNewModel>() { .enterRoomNew(mLiveBean.getStream(), mLiveBean.getUid(), mLiveBean.getCity(), new com.yunbao.common.http.base.HttpCallback<EnterRoomNewModel>() {
@Override @Override
public void onSuccess(EnterRoomNewModel data) { public void onSuccess(EnterRoomNewModel data) {
isEnterRoom = true;
if (TextUtils.isEmpty(leaveStream)) {
leaveStream = mLiveBean.getStream();
leaveGroupId = mLiveBean.getUid();
}
landscape = data.getLiveInfo().getLandscape(); landscape = data.getLiveInfo().getLandscape();
mLivePlayViewHolder.setLiveBeanLandscape(landscape); mLivePlayViewHolder.setLiveBeanLandscape(landscape);
//是否热度卡加成 //是否热度卡加成
liveHandler.postDelayed(() -> mLiveRoomViewHolder.getIsHot(data.getIsUseHotCard()), 700); liveHandler.postDelayed(() -> mLiveRoomViewHolder.getIsHot(data.getIsUseHotCard()), 700);
isEnterRoom = true;
//延时1秒发送 //延时1秒发送
liveHandler.postDelayed(sendFIm, 700); liveHandler.postDelayed(sendFIm, 700);
@ -1501,13 +1506,14 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
} }
if (mLiveBean != null) { if (mLiveBean != null) {
isEnterRoom = false; isEnterRoom = false;
RongChatRoomClient.getInstance().quitChatRoom("g" + mLiveBean.getUid(), new IRongCoreCallback.OperationCallback() { RongChatRoomClient.getInstance().quitChatRoom("g" + mLiveBean.getUid(), new IRongCoreCallback.OperationCallback() {
@Override @Override
public void onSuccess() { public void onSuccess() {
try { try {
Log.i("tx", "退出成功" + mLiveBean.getUid()); Log.i("tx", "退出成功" + mLiveBean.getUid());
LiveNetManager.get(mContext) LiveNetManager.get(mContext)
.leaveRoomNew(mLiveBean.getStream(), mLiveBean.getUid(), new com.yunbao.common.http.base.HttpCallback<String>() { .leaveRoomNew(leaveStream, leaveGroupId, new com.yunbao.common.http.base.HttpCallback<String>() {
@Override @Override
public void onSuccess(String data) { public void onSuccess(String data) {
@ -1515,9 +1521,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
@Override @Override
public void onError(String error) { public void onError(String error) {
} }
}); });
leaveStream = "";
leaveGroupId = "";
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -1528,20 +1535,20 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
@Override @Override
public void onError(IRongCoreEnum.CoreErrorCode coreErrorCode) { public void onError(IRongCoreEnum.CoreErrorCode coreErrorCode) {
try { try {
Log.i("tx", "退出成功" + mLiveBean.getUid()); Log.i("tx", "退出成功" + mLiveBean.getUid());
LiveNetManager.get(mContext) LiveNetManager.get(mContext)
.leaveRoomNew(mLiveBean.getStream(), mLiveBean.getUid(), new com.yunbao.common.http.base.HttpCallback<String>() { .leaveRoomNew(leaveStream, leaveGroupId, new com.yunbao.common.http.base.HttpCallback<String>() {
@Override @Override
public void onSuccess(String data) { public void onSuccess(String data) {
} }
@Override @Override
public void onError(String error) { public void onError(String error) {
} }
}); });
leaveStream = "";
leaveGroupId = "";
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }