diff --git a/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java b/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java index 6e74a4db4..88af69746 100644 --- a/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java +++ b/common/src/main/java/com/yunbao/common/http/CommonHttpUtil.java @@ -215,6 +215,9 @@ public class CommonHttpUtil { if (obj.containsKey("isup")) { APKManager.get().setAPKIsUp(obj.getInteger("isup")); } + if (obj.containsKey("clarity")) { + IMLoginManager.get(context).setClarity(obj.getString("clarity")); + } } catch (Exception e) { String error = "info[0]:" + info[0] + "\n\n\n" + "Exception:" + e.getClass() + "---message--->" + e.getMessage(); ErrorActivity.forward("GetConfig接口返回数据异常", error); diff --git a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java index 84f7b7879..301dc6302 100644 --- a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java +++ b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java @@ -18,7 +18,6 @@ import com.yunbao.common.manager.base.BaseCacheManager; import com.yunbao.common.manager.imrongcloud.MessageIMManager; import com.yunbao.common.manager.imrongcloud.RongcloudIMManager; import com.yunbao.common.utils.SpUtil; -import com.yunbao.common.utils.VersionUtil; import com.yunbao.common.views.floatingview.APPEasyFloat; import org.greenrobot.eventbus.EventBus; @@ -40,8 +39,21 @@ public class IMLoginManager extends BaseCacheManager { private final String IS_HINT = "is_hint"; private final String IS_HINT2 = "is_hint2"; private final String SELECT_CLARITY = "selectClarity"; + private final String CLARITY = "clarity"; + public void setClarity(String clarity) { + put(CLARITY, clarity); + } + + /** + * 1080p开播分辨率:clarity 0关闭 1开启 + * + * @return + */ + public boolean getClarity() { + return TextUtils.equals(getString(CLARITY), "1"); + } /** * 设置清晰度 diff --git a/common/src/main/java/com/yunbao/common/views/LiveClarityCustomPopup.java b/common/src/main/java/com/yunbao/common/views/LiveClarityCustomPopup.java index 5ee55d638..3e5edb01a 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveClarityCustomPopup.java +++ b/common/src/main/java/com/yunbao/common/views/LiveClarityCustomPopup.java @@ -16,7 +16,6 @@ import com.lxj.xpopup.core.BottomPopupView; import com.yunbao.common.R; import com.yunbao.common.utils.DeviceUtils; import com.yunbao.common.utils.ToastUtil; -import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.weight.ViewClicksAntiShake; import java.util.ArrayList; @@ -40,11 +39,10 @@ public class LiveClarityCustomPopup extends BottomPopupView implements View.OnCl } /** - * * @param banSelect 禁止选项,{@link #BAN_720} 禁止高清和超高清。 {@link #BAN_1080} 禁止超高清 - * @param isUser 是否为观众,true 观众,false 主播 + * @param isUser 是否为观众,true 观众,false 主播 */ - public LiveClarityCustomPopup(@NonNull Context context, int selectClarity, int banSelect,boolean isUser) { + public LiveClarityCustomPopup(@NonNull Context context, int selectClarity, int banSelect, boolean isUser) { super(context); this.banSelect = banSelect; if (selectClarity == -1) { @@ -111,11 +109,11 @@ public class LiveClarityCustomPopup extends BottomPopupView implements View.OnCl }); //高清 ViewClicksAntiShake.clicksAntiShake(lineHd, () -> { - if(lineHd.getTag()!=null){ - if(isUser){//用户端 + if (lineHd.getTag() != null) { + if (isUser) {//用户端 ToastUtil.show(R.string.live_user_ban_hd); - }else{//主播端 - ToastUtil.show(""); + } else {//主播端 + ToastUtil.show(R.string.function_is_suspended); } return; } @@ -146,11 +144,11 @@ public class LiveClarityCustomPopup extends BottomPopupView implements View.OnCl }); //超高清 ViewClicksAntiShake.clicksAntiShake(lineFhd, () -> { - if(lineFhd.getTag()!=null){ - if(isUser){//用户端 + if (lineFhd.getTag() != null) { + if (isUser) {//用户端 ToastUtil.show(R.string.live_user_ban_fhd); - }else{//主播端 - ToastUtil.show(""); + } else {//主播端 + ToastUtil.show(R.string.function_is_suspended); } return; } diff --git a/common/src/main/res/values-en/strings.xml b/common/src/main/res/values-en/strings.xml index 867103039..fbe44671d 100644 --- a/common/src/main/res/values-en/strings.xml +++ b/common/src/main/res/values-en/strings.xml @@ -1000,4 +1000,5 @@ Limited ride And limited avatar frame updating There is no choice, the anchor is not turned on FHD live. There is no choice, the anchor is not turned on HD live. + Sorry, this feature is on hold. diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index c5207ac34..2c5c8b5e2 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1020,4 +1020,5 @@ 更新中 無法選擇,該主播未開啟超高清直播。 無法選擇,該主播未開啟高清直播。 + 抱歉,該功能暫停使用中。 diff --git a/config.gradle b/config.gradle index 88d9c1761..78cac4931 100644 --- a/config.gradle +++ b/config.gradle @@ -11,7 +11,7 @@ ext { //正式 // serverHost : "https://napi.yaoulive.com", -// 測試 +// serverHost : "https://ceshi.yaoulive.com", //腾讯地图 @@ -25,7 +25,7 @@ ext { baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S", // true表示谷歌支付 false - isGooglePlay : false, + isGooglePlay : true, //是否上报异常日志 isUploadLog : false ] diff --git a/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java index 418673747..1d71091b1 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java @@ -9,8 +9,6 @@ import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.text.TextUtils; -import android.text.format.Formatter; -import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.view.inputmethod.InputMethodManager; @@ -34,7 +32,6 @@ import com.yunbao.common.http.HttpCallback; import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.ImageResultCallback; import com.yunbao.common.manager.IMLoginManager; -import com.yunbao.common.utils.DeviceUtils; import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.L; import com.yunbao.common.utils.ProcessImageUtil; @@ -63,12 +60,8 @@ import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import java.io.File; -import java.util.Map; import cn.rongcloud.rtc.api.RCRTCEngine; -import cn.rongcloud.rtc.api.callback.IRCRTCStatusReportListener; -import cn.rongcloud.rtc.api.report.StatusBean; -import cn.rongcloud.rtc.api.report.StatusReport; import cn.rongcloud.rtc.api.stream.RCRTCCameraOutputStream; import cn.rongcloud.rtc.api.stream.RCRTCVideoStreamConfig; import cn.rongcloud.rtc.base.RCRTCParamsType; @@ -220,7 +213,11 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl ViewClicksAntiShake .clicksAntiShake( findViewById(R.id.btn_live_clarity), () -> { - LiveClarityCustomPopup liveClarityCustomPopup = new LiveClarityCustomPopup(mContext, IMLoginManager.get(mContext).getSelectClarity()); + + LiveClarityCustomPopup liveClarityCustomPopup = + new LiveClarityCustomPopup(mContext, + IMLoginManager.get(mContext).getSelectClarity(), + IMLoginManager.get(mContext).getClarity() ? 0 : LiveClarityCustomPopup.BAN_1080, false); new XPopup.Builder(mContext) .setPopupCallback(new XPopupCallback() { @Override @@ -330,7 +327,6 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl } - @Override public void onClick(View v) { if (!canClick()) { @@ -377,7 +373,10 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl @Override public void selectClarity(int selectClarity) { - LiveClarityCustomPopup liveClarityCustomPopup = new LiveClarityCustomPopup(mContext, selectClarity); + LiveClarityCustomPopup liveClarityCustomPopup = + new LiveClarityCustomPopup(mContext, + IMLoginManager.get(mContext).getSelectClarity(), + IMLoginManager.get(mContext).getClarity() ? 0 : LiveClarityCustomPopup.BAN_1080, false); new XPopup.Builder(mContext) .setPopupCallback(new XPopupCallback() { @Override