add[声望升级-修复BUG]

This commit is contained in:
Martin 2024-05-14 18:29:28 +08:00
parent afef088555
commit cb376aa83a
4 changed files with 10 additions and 46 deletions

View File

@ -647,9 +647,9 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
msg1.param("is_ladders", "https://downs.yaoulive.com/rank_top_box.png"); msg1.param("is_ladders", "https://downs.yaoulive.com/rank_top_box.png");
msg1.create(); msg1.create();
System.out.println("PK回执 = " + msg1.toString()); System.out.println("PK回执 = " + msg1.toString());
Conversation.ConversationType conversationType = Conversation.ConversationType.CHATROOM; Conversation.ConversationType conversationType = Conversation.ConversationType.PRIVATE;
TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString()); TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString());
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain("g" + bean.getId(), conversationType, messageContent); io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain( bean.getId(), conversationType, messageContent);
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() { RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
@Override @Override
@ -772,6 +772,9 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
isPK(u); isPK(u);
} else { } else {
if (mPkWaitCount < 0) { if (mPkWaitCount < 0) {
if(rtcRoom==null){
return;
}
rtcRoom.getLocalUser().responseJoinOtherRoom(u.getId(), u.getId(), false, false, "extra", new IRCRTCResultCallback() { rtcRoom.getLocalUser().responseJoinOtherRoom(u.getId(), u.getId(), false, false, "extra", new IRCRTCResultCallback() {
@Override @Override
@ -1902,6 +1905,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
* 主播与主播PK 所有人收到PK开始的回调 * 主播与主播PK 所有人收到PK开始的回调
*/ */
public void onLinkMicPkStart(String pkUid, int i) { public void onLinkMicPkStart(String pkUid, int i) {
L.eSw("onLinkMicPkStart pkUid "+pkUid+" "+i);
Log.d("tag", i + "mPkTimeCount2"); Log.d("tag", i + "mPkTimeCount2");
mIsPk = true; mIsPk = true;
hideSendPkWait(); hideSendPkWait();
@ -1910,7 +1914,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
mPkUid = pkUid; mPkUid = pkUid;
mApplyUid = null; mApplyUid = null;
mApplyStream = null; mApplyStream = null;
isDRPK=1;
if (mLiveLinkMicPkViewHolder == null) { if (mLiveLinkMicPkViewHolder == null) {
mLiveLinkMicPkViewHolder = new LiveLinkMicPkViewHolder(mContext, mPkContainer); mLiveLinkMicPkViewHolder = new LiveLinkMicPkViewHolder(mContext, mPkContainer);
mLiveLinkMicPkViewHolder.addToParent(); mLiveLinkMicPkViewHolder.addToParent();
@ -1923,7 +1927,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.PK_TWO_START).setObject(pkUid)); EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.PK_TWO_START).setObject(pkUid));
mLiveLinkMicPkViewHolder.showTime(); mLiveLinkMicPkViewHolder.showTime();
mPkTimeCount = 100; mPkTimeCount = 100;
nextPkTimeCountDown(2); nextPkTimeCountDown(2);//时间倒计时
if (mIsAnchor) { if (mIsAnchor) {
((LiveRyAnchorActivity) mContext).setPkBtnVisible(false); ((LiveRyAnchorActivity) mContext).setPkBtnVisible(false);
mPkTimeCount = PK_TIME_MAX; mPkTimeCount = PK_TIME_MAX;
@ -2000,45 +2004,6 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
} }
} }
}); });
// inputStreamList.clear();
RCRTCMixConfig config = new RCRTCMixConfig();
RCRTCMixConfig.MediaConfig mediaConfig = new RCRTCMixConfig.MediaConfig();
config.setMediaConfig(mediaConfig);
//视频输出配置
RCRTCMixConfig.MediaConfig.VideoConfig videoConfig = new RCRTCMixConfig.MediaConfig.VideoConfig();
mediaConfig.setVideoConfig(videoConfig);
//大流视频的输出参数
RCRTCMixConfig.MediaConfig.VideoConfig.VideoLayout normal = new RCRTCMixConfig.MediaConfig.VideoConfig.VideoLayout();
videoConfig.setVideoLayout(normal);
//推荐宽帧率参数值可以通过默认视频流的配置获取也可以根据实际需求来自定义设置
//如不设置宽高值则服务端将使用默认宽高 360 * 640
//:发布的视频分辨率为720 * 1280如果不设置则观众端看到的视频分辨率为 360 * 640,
//所以如果想让观众端看到的视频分辨率和发布视频分辨率一致则应从发布的视频流中获取分辨率配置并设置到 mediaConfig
RCRTCVideoStreamConfig defaultVideoConfig = RCRTCEngine.getInstance().getDefaultVideoStream().getVideoConfig();
int fps = defaultVideoConfig.getVideoFps().getFps();
int width = 720;
int height = 1280;
normal.setWidth(width); //视频宽
normal.setHeight(height); //视频高
normal.setFps(fps); //视频帧率
//1. 设置自适应合流布局模式
config.setLayoutMode(RCRTCMixConfig.MixLayoutMode.ADAPTIVE);
//2. 合流画布设置
if (rcrtcLiveInfo != null) {
rcrtcLiveInfo.setMixConfig(config, new IRCRTCResultCallback() {
@Override
public void onSuccess() {
Log.e("ry", "混成功16");
}
@Override
public void onFailed(RTCErrorCode errorCode) {
Log.e("ry", "混失败" + errorCode);
}
});
}
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
public void run() { public void run() {

View File

@ -648,7 +648,6 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
} }
}); });
mLiveRyLinkMicPkPresenter.setPkUserInfoView(u); mLiveRyLinkMicPkPresenter.setPkUserInfoView(u);
} }

View File

@ -666,6 +666,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
}else{//单人连麦 }else{//单人连麦
LivePkMicModel connection_info = data.getEnterRoomInfo().getConnectionInfo(); LivePkMicModel connection_info = data.getEnterRoomInfo().getConnectionInfo();
if(!StringUtil.isEmpty(connection_info.getPkuid())){ if(!StringUtil.isEmpty(connection_info.getPkuid())){
mPkUid = connection_info.getPkuid();
mLivePlayViewHolder.setPkView(connection_info.getPkuid()); mLivePlayViewHolder.setPkView(connection_info.getPkuid());
} }
} }

View File

@ -744,9 +744,8 @@
layout="@layout/view_red_packet" layout="@layout/view_red_packet"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/live_rank_pk"
android:layout_marginStart="12dp" android:layout_marginStart="12dp"
android:layout_marginTop="15dp" android:layout_marginTop="100dp"
android:visibility="gone" /> android:visibility="gone" />
<FrameLayout <FrameLayout