优化观众端选择分辨率弹框的代码可读性
This commit is contained in:
parent
76055543c3
commit
1db24dae4b
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user