From ee6a4288b07bc7553570b68c2108abcc728d2245 Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Mon, 9 Jan 2023 20:30:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=92=AD=E6=94=BE=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/bean/EnterRoomInfoModel.java | 4 ++ .../yunbao/common/bean/EnterRoomNewModel.java | 16 ++++++++ .../java/com/yunbao/common/bean/LiveBean.java | 40 ++++++++++++++++++- .../live/views/LivePlayRyViewHolder.java | 9 +++-- 4 files changed, 64 insertions(+), 5 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/bean/EnterRoomInfoModel.java b/common/src/main/java/com/yunbao/common/bean/EnterRoomInfoModel.java index 87e6e14c4..1a6af9aa9 100644 --- a/common/src/main/java/com/yunbao/common/bean/EnterRoomInfoModel.java +++ b/common/src/main/java/com/yunbao/common/bean/EnterRoomInfoModel.java @@ -1,6 +1,7 @@ package com.yunbao.common.bean; import com.google.gson.annotations.SerializedName; +import com.yunbao.common.utils.StringUtil; import java.util.List; @@ -475,6 +476,9 @@ public class EnterRoomInfoModel extends BaseModel { } public String getIsconnection() { + if(StringUtil.isEmpty(isconnection)){ + isconnection="0"; + } return isconnection; } diff --git a/common/src/main/java/com/yunbao/common/bean/EnterRoomNewModel.java b/common/src/main/java/com/yunbao/common/bean/EnterRoomNewModel.java index 66daf307c..e0228b8d0 100644 --- a/common/src/main/java/com/yunbao/common/bean/EnterRoomNewModel.java +++ b/common/src/main/java/com/yunbao/common/bean/EnterRoomNewModel.java @@ -119,4 +119,20 @@ public class EnterRoomNewModel extends BaseModel { public void setClarityType(int clarityType) { this.clarityType = clarityType; } + + @Override + public String toString() { + return "EnterRoomNewModel{" + + "liveInfo=" + liveInfo + + ", enterRoomInfo=" + enterRoomInfo + + ", rankHour=" + rankHour + + ", newPeopleTask=" + newPeopleTask + + ", wishList=" + wishList + + ", guardUserAvatar=" + guardUserAvatar + + ", activeList=" + activeList + + ", isUseHotCard='" + isUseHotCard + '\'' + + ", liveRoomActivityModels=" + liveRoomActivityModels + + ", clarityType=" + clarityType + + '}'; + } } diff --git a/common/src/main/java/com/yunbao/common/bean/LiveBean.java b/common/src/main/java/com/yunbao/common/bean/LiveBean.java index b5567764b..7dbafa055 100644 --- a/common/src/main/java/com/yunbao/common/bean/LiveBean.java +++ b/common/src/main/java/com/yunbao/common/bean/LiveBean.java @@ -493,6 +493,44 @@ public class LiveBean implements Parcelable { @Override public String toString() { - return "uid: " + uid + " , userNiceName: " + userNiceName + " ,playUrl: " + pull; + return "LiveBean{" + + "uid='" + uid + '\'' + + ", avatar='" + avatar + '\'' + + ", avatarThumb='" + avatarThumb + '\'' + + ", userNiceName='" + userNiceName + '\'' + + ", title='" + title + '\'' + + ", city='" + city + '\'' + + ", stream='" + stream + '\'' + + ", pull='" + pull + '\'' + + ", thumb='" + thumb + '\'' + + ", nums='" + nums + '\'' + + ", sex=" + sex + + ", distance='" + distance + '\'' + + ", levelAnchor=" + levelAnchor + + ", type=" + type + + ", typeVal='" + typeVal + '\'' + + ", goodNum='" + goodNum + '\'' + + ", gameAction=" + gameAction + + ", game='" + game + '\'' + + ", islive='" + islive + '\'' + + ", isTop='" + isTop + '\'' + + ", pk_avatar_thumb='" + pk_avatar_thumb + '\'' + + ", landscape=" + landscape + + ", hot_num='" + hot_num + '\'' + + ", content_pic_size_one='" + content_pic_size_one + '\'' + + ", content_pic_size_two='" + content_pic_size_two + '\'' + + ", content_pic_size_three='" + content_pic_size_three + '\'' + + ", is_week='" + is_week + '\'' + + ", img='" + img + '\'' + + ", url='" + url + '\'' + + ", drpk_status='" + drpk_status + '\'' + + ", is_rong=" + is_rong + + ", isattention='" + isattention + '\'' + + ", recommendCardtype='" + recommendCardtype + '\'' + + ", recommendCardIconSizeTwo='" + recommendCardIconSizeTwo + '\'' + + ", recommendCardIconSizeThree='" + recommendCardIconSizeThree + '\'' + + ", params=" + params + + ", mWeekList=" + mWeekList + + '}'; } } 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 cce26f97f..2e0e1a5b9 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java @@ -244,7 +244,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { @Override public void setLiveEnterRoomNewModel(EnterRoomNewModel data) { super.setLiveEnterRoomNewModel(data); - mPlayer.clearFrame(); + isPk=data.getEnterRoomInfo().getIsconnection().equals("1"); } /** @@ -283,9 +283,9 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { if (playModel != PLAY_MODEL_DEF && !url.contains(videoFps[0] + ".flv")) { mPlayer.setViewResizeMode(landscape == VIDEO_VERTICAL); if (landscape == VIDEO_VERTICAL) { - url = url.replace(".flv", videoRatioVertical[playModel] + videoFps[0] + ".flv"); + waitNextUrl = url.replace(".flv", videoRatioVertical[playModel] + videoFps[0] + ".flv"); } else if (landscape == VIDEO_HORIZONTAL) { - url = url.replace(".flv", videoRatioHorizontal[playModel] + videoFps[0] + ".flv"); + waitNextUrl = url.replace(".flv", videoRatioHorizontal[playModel] + videoFps[0] + ".flv"); } } else if (!url.contains(videoFps[0] + ".flv")) { mPlayer.setViewResizeMode(false); @@ -311,7 +311,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { public void switchStream(String url, int playModel) { srcUrl = url; PLAY_MODEL = playModel; - Log.i(TAG, "switchStream: " + " url:" + url + " playModel: " + playModel + " landscape: " + landscape + " videoLandscape = " + videoLandscape); + Log.i(TAG, "switchStream: " + " url:" + url + " playModel: " + playModel + " landscape: " + landscape + " videoLandscape = " + videoLandscape + " ispk = " + isPk+" bean = "+roomModel.getEnterRoomInfo().getIsconnection()); if (playModel != PLAY_MODEL_DEF && !url.contains(videoFps[0] + ".flv")) { mPlayer.setViewResizeMode(landscape == VIDEO_VERTICAL); if (landscape == VIDEO_VERTICAL && !isPk) { @@ -487,6 +487,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { public void setPkview() { Log.i("收到socket--->", "变成16:9"); String url = srcUrl; + isPk = true; switchStreamPk(true); RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mVideoView.getLayoutParams(); params.height = vHeight;