优化观众端选择分辨率弹框的代码可读性
This commit is contained in:
parent
76055543c3
commit
1db24dae4b
@ -686,7 +686,17 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
|||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void onOpenDrawer(LiveAudienceEvent event) {
|
public void onOpenDrawer(LiveAudienceEvent event) {
|
||||||
if (event.getType() == LiveAudienceEvent.LiveAudienceType.LIVE_VIDEO) {
|
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);
|
LiveClarityCustomPopup liveClarityCustomPopup = new LiveClarityCustomPopup(mContext, PLAY_MODEL, ban);
|
||||||
new XPopup.Builder(mContext)
|
new XPopup.Builder(mContext)
|
||||||
.setPopupCallback(new XPopupCallback() {
|
.setPopupCallback(new XPopupCallback() {
|
||||||
|
Loading…
Reference in New Issue
Block a user