修改主播端选择分辨率的方法,接口新增参数

This commit is contained in:
18401019693 2023-01-05 18:13:43 +08:00
parent 2f413e260e
commit d26a687385
7 changed files with 39 additions and 25 deletions

View File

@ -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);

View File

@ -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");
}
/**
* 设置清晰度

View File

@ -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;
}

View File

@ -1000,4 +1000,5 @@ Limited ride And limited avatar frame</string>
<string name="updating" >updating</string>
<string name="live_user_ban_fhd" >There is no choice, the anchor is not turned on FHD live.</string>
<string name="live_user_ban_hd" >There is no choice, the anchor is not turned on HD live.</string>
<string name="function_is_suspended" >Sorry, this feature is on hold.</string>
</resources>

View File

@ -1020,4 +1020,5 @@
<string name="updating" >更新中</string>
<string name="live_user_ban_fhd" >無法選擇,該主播未開啟超高清直播。</string>
<string name="live_user_ban_hd" >無法選擇,該主播未開啟高清直播。</string>
<string name="function_is_suspended" >抱歉,該功能暫停使用中。</string>
</resources>

View File

@ -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
]

View File

@ -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