From 1db24dae4baba5a6f45b8cb6e3d6910afcf88eb3 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Tue, 3 Jan 2023 14:26:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=A7=82=E4=BC=97=E7=AB=AF?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=88=86=E8=BE=A8=E7=8E=87=E5=BC=B9=E6=A1=86?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81=E5=8F=AF=E8=AF=BB=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/live/views/LivePlayRyViewHolder.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 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 45788c763..98751cbb3 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java @@ -686,7 +686,17 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { @Subscribe(threadMode = ThreadMode.MAIN) public void onOpenDrawer(LiveAudienceEvent event) { if (event.getType() == LiveAudienceEvent.LiveAudienceType.LIVE_VIDEO) { - int ban = roomModel.getClarityType() - 1 == PLAY_MODEL_720 ? LiveClarityCustomPopup.BAN_1080 : roomModel.getClarityType() - 1 == PLAY_MODEL_480 ? LiveClarityCustomPopup.BAN_720 : 0; + int ban = 0;//全模式都可以选择 + switch (roomModel.getClarityType() - 1) { + case PLAY_MODEL_720://仅允许720(高清),ban掉1080(超高清)模式 + ban = LiveClarityCustomPopup.BAN_1080; + break; + case -1://没有该字段 + case PLAY_MODEL_480://仅允许480(流畅),ban掉1080(超高清)和720(高清)模式 + ban = LiveClarityCustomPopup.BAN_720; + break; + + } LiveClarityCustomPopup liveClarityCustomPopup = new LiveClarityCustomPopup(mContext, PLAY_MODEL, ban); new XPopup.Builder(mContext) .setPopupCallback(new XPopupCallback() { @@ -1050,7 +1060,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { public void onVideoSizeChanged(VideoSize videoSize) { Player.Listener.super.onVideoSizeChanged(videoSize); Log.i(TAG, "onVideoSizeChanged: width = " + videoSize.width + " height = " + videoSize.height); - // ToastUtil.show("分辨率: width = " + videoSize.width + " height = " + videoSize.height); + // ToastUtil.show("分辨率: width = " + videoSize.width + " height = " + videoSize.height); if (videoSize.height > videoSize.width) { videoLandscape = VIDEO_VERTICAL; } else {