From 4a4cc179bfac00b0c389cedaa9f430e533dab697 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Thu, 13 Apr 2023 16:26:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8D=95=E4=BA=BAPK?= =?UTF-8?q?=E7=BB=93=E7=AE=97=E5=90=8E=E6=96=B0=E8=BF=9B=E6=9D=A5=E7=AB=96?= =?UTF-8?q?=E5=B1=8F=E7=9B=B4=E6=92=AD=E9=97=B4=EF=BC=8C=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../live/views/LivePlayRyViewHolder.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java index 0267d522b..6399477ad 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java @@ -209,12 +209,12 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { @Override public synchronized void setLiveBeanLandscape(int landscape) { // landscape=1; - Log.i(TAG, "setLiveBeanLandscape: " + landscape); + Log.i(TAG, "setLiveBeanLandscape: " + landscape + " isPk: " + isPk); this.landscape = landscape; this.videoLandscape = landscape; mPlayer.setViewResizeMode(landscape == VIDEO_VERTICAL); if (landscape == 2) { - Log.i("收到socket--->", "还原9:16"); + Log.i(TAG, "还原9:16"); RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams(); params.height = RelativeLayout.LayoutParams.MATCH_PARENT; params.topMargin = 0; @@ -233,6 +233,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { mCover.requestLayout(); } else { + Log.i(TAG, "还原16:9"); RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams(); params.height = vHeight; params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top); @@ -258,6 +259,9 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { public void setLiveEnterRoomNewModel(EnterRoomNewModel data) { super.setLiveEnterRoomNewModel(data); isPk = data.getEnterRoomInfo().getIsconnection().equals("1"); + if (isPk) { + setLiveBeanLandscape(1); + } } /** @@ -443,7 +447,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { @Override public void setViewUP(int i) { if (mVideoView == null) return; - Log.e("收", "整理" + i); + Log.e("PK状态", "" + i); RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams(); params.height = vHeight; params.topMargin = contexts.getResources().getDimensionPixelOffset(R.dimen.live_top); @@ -478,7 +482,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { } mPlayer.setViewResizeMode(landscape == VIDEO_VERTICAL); if (landscape == 2) { - Log.i("收到socket--->", "还原9:16"); + Log.i(TAG, "onPrepared:还原9:16 land=" + videoLandscape); RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams(); params.height = height; params.topMargin = 0; @@ -497,6 +501,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { mCover.setLayoutParams(params2); mCover.requestLayout(); } else { + Log.i(TAG, "onPrepared:还原16:9"); RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams(); params.height = height; params.topMargin = 0; @@ -744,7 +749,8 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { Log.e("ry", "下麦失败" + errorCode); leaveRoom(); } - private void leaveRoom(){ + + private void leaveRoom() { RCRTCEngine.getInstance().leaveRoom(new IRCRTCResultCallback() { @Override public void onSuccess() { @@ -925,7 +931,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { UsertoRY(); } }); - }else{ + } else { ToastUtil.show("房间失败" + errorCode); } @@ -941,9 +947,9 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { public void run() { RCRTCEngine.getInstance().enableSpeaker(true); //遍历远端用户发布的资源列表 - Log.i(TAG, "软件资源数量:"+data.getLiveStreams().size()); + Log.i(TAG, "软件资源数量:" + data.getLiveStreams().size()); for (RCRTCInputStream stream : data.getLiveStreams()) { - Log.i(TAG, "资源流 type: "+stream.getMediaType()); + Log.i(TAG, "资源流 type: " + stream.getMediaType()); if (stream.getMediaType() == RCRTCMediaType.VIDEO) { //暂停播放 mPlayer.stop(); From bb4f8bb98e3edb18855a2ca077a0fac846a73bea Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Thu, 13 Apr 2023 16:44:40 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=BF=83=E6=84=BF=E5=8D=95=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=8A=A0=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/live/activity/LiveRyAnchorActivity.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java index 0964f123f..29e0454e3 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -42,7 +42,6 @@ import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppContext; import com.yunbao.common.Constants; import com.yunbao.common.bean.AiAutomaticSpeechModel; -import com.yunbao.common.bean.HttpCallbackModel; import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.LinkMicUserBean; import com.yunbao.common.bean.LiveAiRobotBean; @@ -51,7 +50,6 @@ import com.yunbao.common.bean.LiveUserGiftBean; import com.yunbao.common.bean.MicUserBean; import com.yunbao.common.bean.UserBean; import com.yunbao.common.dialog.NotCancelableDialog; -import com.yunbao.common.event.LiveRobotMessageEvent; import com.yunbao.common.event.LoginInvalidEvent; import com.yunbao.common.http.CommonHttpConsts; import com.yunbao.common.http.CommonHttpUtil; @@ -71,7 +69,6 @@ import com.yunbao.common.utils.MicStatusManager; import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; -import com.yunbao.common.views.InputCustomPopup; import com.yunbao.common.views.LiveNewWishListPopup; import com.yunbao.common.views.LiveRobotSettingCustomPopup; import com.yunbao.faceunity.FaceManager; @@ -81,7 +78,6 @@ import com.yunbao.live.bean.LiveKsyConfigBean; import com.yunbao.live.bean.LiveReceiveGiftBean; import com.yunbao.live.dialog.FreePkDialogFragment; import com.yunbao.live.dialog.LiveNewFunctionDialogFragment; -import com.yunbao.live.dialog.LiveNewWishListDialogFragment; import com.yunbao.live.dialog.LivePrankDialogFragment; import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience; import com.yunbao.live.dialog.RandomPkDialogFragment; @@ -383,6 +379,9 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl } break; case Constants.LIVE_FUNC_DR://多人PK +// if (LiveRyLinkMicPkPresenter.inputStreamList.size() == 4) { +// return; +// } if (isDRPK != 1) { HttpClient.getInstance().get("live.getdrnum", "live.getdrnum") .execute(new HttpCallback() { @@ -520,6 +519,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl default: break; } + }