准备提交暂停

This commit is contained in:
ningwenqiang 2024-08-23 16:19:42 +08:00
parent 1df8d443f7
commit 5bec6c1b79
5 changed files with 47 additions and 8 deletions

View File

@ -171,6 +171,8 @@ public class SWAuManager extends BaseCacheManager {
frameLayout.addView(surfaceView); frameLayout.addView(surfaceView);
VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, uid); VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, uid);
Log.i("nwq","updateMyChannelView::setupRemoteVideo");
mRtcEngine.setupRemoteVideo(videoCanvas); mRtcEngine.setupRemoteVideo(videoCanvas);
} }
@ -232,6 +234,7 @@ public class SWAuManager extends BaseCacheManager {
// surfaceView.setZOrderMediaOverlay(true); // surfaceView.setZOrderMediaOverlay(true);
pkContainer1.addView(surfaceView); pkContainer1.addView(surfaceView);
VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, strUid); VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, strUid);
Log.i("nwq","joinExRoomEx::setupRemoteVideoEx");
mRtcEngine.setupRemoteVideoEx(videoCanvas, rtcConnection); mRtcEngine.setupRemoteVideoEx(videoCanvas, rtcConnection);
} }
}); });
@ -312,6 +315,7 @@ public class SWAuManager extends BaseCacheManager {
// surfaceView.setZOrderMediaOverlay(true); // surfaceView.setZOrderMediaOverlay(true);
frameLayout.addView(surfaceView); frameLayout.addView(surfaceView);
VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, Integer.parseInt(toUid)); VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, Integer.parseInt(toUid));
Log.i("nwq","joinChannelDrEx::setupRemoteVideoEx");
mRtcEngine.setupRemoteVideoEx(videoCanvas, rtcConnection); mRtcEngine.setupRemoteVideoEx(videoCanvas, rtcConnection);
} }
}); });
@ -393,6 +397,7 @@ public class SWAuManager extends BaseCacheManager {
// surfaceView.setZOrderMediaOverlay(true); // surfaceView.setZOrderMediaOverlay(true);
audienceContainer.addView(surfaceView); audienceContainer.addView(surfaceView);
// TextureView 对象传入声网实时互动 SDK设置远端视图 // TextureView 对象传入声网实时互动 SDK设置远端视图
Log.i("nwq","setupRemoteVideo::setupRemoteVideo");
mRtcEngine.setupRemoteVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, uid)); mRtcEngine.setupRemoteVideo(new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, uid));
} }

View File

@ -638,8 +638,13 @@ public class LiveAudienceActivity extends LiveActivity {
} }
@Override @Override
public void onBackPressed() { public void onBackPressed() {
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
return;
}
if (manager != null && manager.getsudGameMin()) { if (manager != null && manager.getsudGameMin()) {
new XPopup.Builder(mContext).asCustom(new HintCustomPopup(mContext, mContext.getString(com.yunbao.common.R.string.dialog_tip), mContext.getString(com.yunbao.common.R.string.the_live_room)).setLiveOpenOk(mContext.getString(com.yunbao.common.R.string.confirm)).setLiveOpenCancel(mContext.getString(com.yunbao.common.R.string.cancel)).setCallBack(new HintCustomPopup.HintCustomCallBack() { new XPopup.Builder(mContext).asCustom(new HintCustomPopup(mContext, mContext.getString(com.yunbao.common.R.string.dialog_tip), mContext.getString(com.yunbao.common.R.string.the_live_room)).setLiveOpenOk(mContext.getString(com.yunbao.common.R.string.confirm)).setLiveOpenCancel(mContext.getString(com.yunbao.common.R.string.cancel)).setCallBack(new HintCustomPopup.HintCustomCallBack() {
@Override @Override
@ -914,9 +919,18 @@ public class LiveAudienceActivity extends LiveActivity {
onConfigurationChangedView(newConfig); onConfigurationChangedView(newConfig);
} }
public void onConfigurationChangedView( Configuration newConfig) { public void onConfigurationChangedView(Configuration newConfig) {
// liveHandler.post(liveRunnable);
if (manager != null && manager.getRootView() != null && mLiveBean != null && mViewGroup != null) { if (manager != null && manager.getRootView() != null && mLiveBean != null && mViewGroup != null) {
Log.i("nwq", "横竖屏进行切换");
manager.onConfigurationChanged(newConfig); manager.onConfigurationChanged(newConfig);
// liveHandler.post(liveRunnable);
// View rootView = manager.getRootView();
// if (rootView.getParent() != null && rootView.getParent() instanceof ViewGroup) {
// ((ViewGroup) (rootView.getParent())).removeView(rootView);
// manager.onRemove(false);
// }
// mViewGroup.addView(manager.getRootView());
manager.onAdd(mLiveBean, mLiveType, mLiveTypeVal, mLiveSDK, isSw); manager.onAdd(mLiveBean, mLiveType, mLiveTypeVal, mLiveSDK, isSw);
} }

View File

@ -192,10 +192,6 @@ public class LivePlaySwViewHolder extends LiveRoomPlayViewHolder {
if (contexts == null) { if (contexts == null) {
return; return;
} }
//如果mContentView有父类则移除
if (mContentView != null && mContentView.getParent() != null) {
((ViewGroup) mContentView.getParent()).removeView(mContentView);
}
//这里考虑只通过修改参数的方式实现 //这里考虑只通过修改参数的方式实现
if (isPhysicalScreenVertical()) { if (isPhysicalScreenVertical()) {
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mPkContainer.getLayoutParams(); RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mPkContainer.getLayoutParams();
@ -214,6 +210,15 @@ public class LivePlaySwViewHolder extends LiveRoomPlayViewHolder {
dr_pk_view.requestLayout(); dr_pk_view.requestLayout();
} }
params = (RelativeLayout.LayoutParams) ry_view.getLayoutParams();
params.height = DpUtil.dp2px(280);
params.topMargin = DpUtil.dp2px(130);
ry_view.setLayoutParams(params);
if (ry_view.getVisibility() == View.VISIBLE) {
ry_view.requestLayout();
}
} else { } else {
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mPkContainer.getLayoutParams(); RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mPkContainer.getLayoutParams();
params.height = ViewGroup.LayoutParams.MATCH_PARENT; params.height = ViewGroup.LayoutParams.MATCH_PARENT;
@ -230,9 +235,16 @@ public class LivePlaySwViewHolder extends LiveRoomPlayViewHolder {
if (dr_pk_view.getVisibility() == View.VISIBLE) { if (dr_pk_view.getVisibility() == View.VISIBLE) {
dr_pk_view.requestLayout(); dr_pk_view.requestLayout();
} }
params = (RelativeLayout.LayoutParams) ry_view.getLayoutParams();
params.height = ViewGroup.LayoutParams.MATCH_PARENT;
params.topMargin = 0;
ry_view.setLayoutParams(params);
if (ry_view.getVisibility() == View.VISIBLE) {
ry_view.requestLayout();
}
} }
swAuManager.joinRoom(CommonAppConfig.getInstance().getUid(), CommonAppConfig.SWToken, liveUid, SWAuManager.getChannelName(liveUid));
} }

View File

@ -2369,6 +2369,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
public void resetViewGone() { public void resetViewGone() {
goto_room_view.setVisibility(View.GONE); goto_room_view.setVisibility(View.GONE);
mPkRankTopIcon.setVisibility(View.GONE); mPkRankTopIcon.setVisibility(View.GONE);
Log.i("nwq","LiveRoomViewHolder::resetViewGone");
lt_pk_line.setVisibility(View.GONE); lt_pk_line.setVisibility(View.GONE);
time.setVisibility(View.GONE); time.setVisibility(View.GONE);
if (!SpUtil.getInstance().getBooleanValue("private_chat_message_switch")) { if (!SpUtil.getInstance().getBooleanValue("private_chat_message_switch")) {
@ -3306,7 +3307,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
//双人pk显示 //双人pk显示
public void UpPkTwo() { public void UpPkTwo() {
Log.i("nwq","LiveRoomViewHolder::UpPkTwo");
if (lt_pk_line.getVisibility() == View.VISIBLE) return; if (lt_pk_line.getVisibility() == View.VISIBLE) return;
Log.i("nwq","LiveRoomViewHolder::UpPkTwo22");
ScreenDimenUtil util = ScreenDimenUtil.getInstance(); ScreenDimenUtil util = ScreenDimenUtil.getInstance();
int mScreenWdith = util.getScreenWdith(); int mScreenWdith = util.getScreenWdith();
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) lt_pk_line.getLayoutParams(); RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) lt_pk_line.getLayoutParams();

View File

@ -1130,7 +1130,12 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
@Override @Override
public void onConfigurationChanged(Configuration newConfig) { public void onConfigurationChanged(Configuration newConfig) {
mLivePlayViewHolder.onConfigureChange(); mLiveRoomViewHolder.removeView();
mLiveRoomViewHolder = new LiveRoomViewHolder(false, 1, mContext, mContainer, mSecondPage.findViewById(R.id.gift_gif), mSecondPage.findViewById(R.id.gift_svga), mContainerWrap, mContext.getWindowManager(), isSw);
mLiveRoomViewHolder.subscribeActivityLifeCycle();
mLiveRoomViewHolder.addToParent();
// mLivePlayViewHolder.onConfigureChange();
} }
@Override @Override