修改融云结束连麦还有对方画面的问题

This commit is contained in:
18142669586 2023-08-10 11:15:06 +08:00
parent 02b70d559d
commit 2057a3575f
4 changed files with 32 additions and 7 deletions

View File

@ -228,7 +228,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
long lossRate = statusBean.packetLostRate; long lossRate = statusBean.packetLostRate;
//带宽 //带宽
String googAvailableSendBandwidth = statusReport.googAvailableSendBandwidth; String googAvailableSendBandwidth = statusReport.googAvailableSendBandwidth;
Log.e("网速和内存", "获取视频:" + resolution + " 丢包率:" + lossRate + " 带宽:" + googAvailableSendBandwidth); // Log.e("网速和内存", "获取视频:" + resolution + " 丢包率:" + lossRate + " 带宽:" + googAvailableSendBandwidth);
} }
} }
}); });
@ -1632,6 +1632,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
case DISCONNEXT_PK_TIME: case DISCONNEXT_PK_TIME:
if (mLivePushViewHolder != null) { if (mLivePushViewHolder != null) {
mLivePushViewHolder.changeToBig(); mLivePushViewHolder.changeToBig();
mLiveRyLinkMicPkPresenter.leaveDRRoom();
} }
break; break;
case AI_AUTOMATIC_SPEECH: case AI_AUTOMATIC_SPEECH:

View File

@ -4,6 +4,7 @@ import static com.blankj.utilcode.util.SnackbarUtils.dismiss;
import static com.lzy.okgo.utils.HttpUtils.runOnUiThread; import static com.lzy.okgo.utils.HttpUtils.runOnUiThread;
import static com.yunbao.common.Constants.SOCKET_LINK_MIC_PK; import static com.yunbao.common.Constants.SOCKET_LINK_MIC_PK;
import static com.yunbao.common.Constants.SOCKET_LIVE_DRPK; import static com.yunbao.common.Constants.SOCKET_LIVE_DRPK;
import static com.yunbao.live.activity.LiveRyAnchorActivity.PKing;
import static com.yunbao.live.activity.LiveRyAnchorActivity.isDRPK; import static com.yunbao.live.activity.LiveRyAnchorActivity.isDRPK;
import static com.yunbao.live.views.LivePushRyViewHolder.btn_close; import static com.yunbao.live.views.LivePushRyViewHolder.btn_close;
import static com.yunbao.live.views.LivePushRyViewHolder.contexts; import static com.yunbao.live.views.LivePushRyViewHolder.contexts;
@ -2324,12 +2325,21 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
* 主播与主播PK 断开连麦PK的回调 * 主播与主播PK 断开连麦PK的回调
*/ */
public void onLinkMicPkClose(int i) { public void onLinkMicPkClose(int i) {
Log.e("ry",mPkUid+"aaaaqwqw"+i);
PKing = false;
LiveRyAnchorActivity.isDRPK = 0;
// //恢复播放画面 // //恢复播放画面
if (i == 1) { if (i == 1) {
if (btn_close != null) { runOnUiThread(new Runnable() {
btn_close.setVisibility(View.GONE); @Override
} public void run() {
if (btn_close != null) {
btn_close.setVisibility(View.GONE);
}
}
});
// inputStreamList.clear(); // inputStreamList.clear();
RCRTCMixConfig config = new RCRTCMixConfig(); RCRTCMixConfig config = new RCRTCMixConfig();
RCRTCMixConfig.MediaConfig mediaConfig = new RCRTCMixConfig.MediaConfig(); RCRTCMixConfig.MediaConfig mediaConfig = new RCRTCMixConfig.MediaConfig();

View File

@ -70,6 +70,7 @@ import org.greenrobot.eventbus.EventBus;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.util.List; import java.util.List;
import cn.rongcloud.rtc.api.RCRTCEngine;
import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback; import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback;
import cn.rongcloud.rtc.base.RTCErrorCode; import cn.rongcloud.rtc.base.RTCErrorCode;
import io.rong.imlib.IRongCoreCallback; import io.rong.imlib.IRongCoreCallback;
@ -1262,9 +1263,22 @@ public class SocketRyClient {
mListener.onLinkMicPkStart(map.getString("pkuid"), map.getString("pkhead"), map.getString("pkname"), map.getString("is_ladders")); mListener.onLinkMicPkStart(map.getString("pkuid"), map.getString("pkhead"), map.getString("pkname"), map.getString("is_ladders"));
break; break;
case 5://PK时候断开连麦的回调 case 5://PK时候断开连麦的回调
if (rtcRoom != null) { // if (rtcRoom != null) {
Bus.get().post(new LiveAudienceEvent() Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.DISCONNEXT_PK_TIME)); .setType(LiveAudienceEvent.LiveAudienceType.DISCONNEXT_PK_TIME));
RCRTCEngine.getInstance().leaveOtherRoom(map.getString("pkuid"), true, new IRCRTCResultCallback() {
@Override
public void onSuccess() {
Log.e("ry", map.getString("pkuid")+"退出多人成功a as");
}
@Override
public void onFailed(RTCErrorCode rtcErrorCode) {
Log.e("ry", map.getString("pkuid")+"退asa出多人失败" + rtcErrorCode);
}
});
//断开连麦 //断开连麦
HttpClient.getInstance().post("livepk.setliveuserout", "livepk.setliveuserout") HttpClient.getInstance().post("livepk.setliveuserout", "livepk.setliveuserout")
.execute(new HttpCallback() { .execute(new HttpCallback() {
@ -1273,7 +1287,7 @@ public class SocketRyClient {
} }
}); });
} // }
mListener.onLinkMicPkClose(1); mListener.onLinkMicPkClose(1);
if (RandomPkManager.getInstance().isRandomModel()) { if (RandomPkManager.getInstance().isRandomModel()) {
RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_DEFAULT); RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_DEFAULT);

View File

@ -4,6 +4,7 @@ import static com.lzy.okgo.utils.HttpUtils.runOnUiThread;
import static com.yunbao.common.Constants.SOCKET_LINK_MIC_PK; import static com.yunbao.common.Constants.SOCKET_LINK_MIC_PK;
import static com.yunbao.common.Constants.SOCKET_LIVE_DRPK; import static com.yunbao.common.Constants.SOCKET_LIVE_DRPK;
import static com.yunbao.live.activity.LiveActivity.mLiveRyLinkMicPkPresenter; import static com.yunbao.live.activity.LiveActivity.mLiveRyLinkMicPkPresenter;
import static com.yunbao.live.activity.LiveRyAnchorActivity.PKing;
import static com.yunbao.live.presenter.LiveRyLinkMicPkPresenter.inputStreamList; import static com.yunbao.live.presenter.LiveRyLinkMicPkPresenter.inputStreamList;
import static com.yunbao.live.presenter.LiveRyLinkMicPkPresenter.inputStreamList1; import static com.yunbao.live.presenter.LiveRyLinkMicPkPresenter.inputStreamList1;
import static cn.rongcloud.rtc.base.RCRTCLiveRole.BROADCASTER; import static cn.rongcloud.rtc.base.RCRTCLiveRole.BROADCASTER;
@ -436,7 +437,6 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
@Override @Override
public void onSuccess() { public void onSuccess() {
Log.e("ry",roomId+"退出啊房间成功"+userId); Log.e("ry",roomId+"退出啊房间成功"+userId);
} }
@Override @Override