直播间参数的回传

This commit is contained in:
18401019693 2022-08-23 10:21:34 +08:00
parent 6250e1d012
commit ad0282b066
9 changed files with 141 additions and 33 deletions

View File

@ -29,8 +29,7 @@ import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.UserBean; import com.yunbao.common.bean.UserBean;
import com.yunbao.common.dialog.EffectsSettingsDialog; import com.yunbao.common.dialog.EffectsSettingsDialog;
import com.yunbao.common.dialog.LiveChargeDialogFragment; import com.yunbao.common.dialog.LiveChargeDialogFragment;
import com.yunbao.common.dialog.LiveTotalDialog; import com.yunbao.live.dialog.LiveTotalDialog;
import com.yunbao.common.event.LiveAudienceEvent;
import com.yunbao.common.http.CommonHttpConsts; import com.yunbao.common.http.CommonHttpConsts;
import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
@ -56,6 +55,7 @@ import com.yunbao.live.dialog.LiveMicUserDialogFragment;
import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience; import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience;
import com.yunbao.live.dialog.SidebarLiveAudience; import com.yunbao.live.dialog.SidebarLiveAudience;
import com.yunbao.live.event.LinkMicTxAccEvent; import com.yunbao.live.event.LinkMicTxAccEvent;
import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.live.event.LiveRoomChangeEvent; import com.yunbao.live.event.LiveRoomChangeEvent;
import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpConsts;
import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.http.LiveHttpUtil;
@ -794,6 +794,22 @@ public class LiveAudienceActivity extends LiveActivity {
fragment4Audience.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveWishListDialogFragmentAudience"); fragment4Audience.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveWishListDialogFragmentAudience");
} }
break; break;
case OPEN_PARAMETERS:
mDanmuPrice = TextUtils.equals(event.getParametersModel().getmDanmuPrice(), mDanmuPrice) ?
mDanmuPrice : event.getParametersModel().getmDanmuPrice();
mSocketUserType = TextUtils.equals(String.valueOf(mSocketUserType), String.valueOf(event.getParametersModel().getmSocketUserType())) ?
mSocketUserType : event.getParametersModel().getmSocketUserType();
mChatLevel = TextUtils.equals(String.valueOf(mChatLevel), String.valueOf(event.getParametersModel().getmChatLevel())) ?
mChatLevel : event.getParametersModel().getmChatLevel();
mDanMuLevel = TextUtils.equals(String.valueOf(mDanMuLevel), String.valueOf(event.getParametersModel().getmDanMuLevel())) ?
mDanMuLevel : event.getParametersModel().getmDanMuLevel();
mLiveType = TextUtils.equals(String.valueOf(mLiveType), String.valueOf(event.getParametersModel().getmLiveType())) ?
mLiveType : event.getParametersModel().getmLiveType();
mLiveTypeVal = TextUtils.equals(String.valueOf(mLiveTypeVal), String.valueOf(event.getParametersModel().getmLiveTypeVal())) ?
mLiveTypeVal : event.getParametersModel().getmLiveTypeVal();
mLiveGuardInfo = event.getParametersModel().getmLiveGuardInfo() == null ?
mLiveGuardInfo : event.getParametersModel().getmLiveGuardInfo();
break;
} }

View File

@ -1,4 +1,4 @@
package com.yunbao.common.adapter; package com.yunbao.live.adapter;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
@ -9,7 +9,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R; import com.yunbao.common.R;
import com.yunbao.common.bean.ActiveModel; import com.yunbao.common.bean.ActiveModel;
import com.yunbao.common.views.FunGamesViewHolder; import com.yunbao.live.views.FunGamesViewHolder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@ -0,0 +1,81 @@
package com.yunbao.live.bean;
import com.yunbao.common.bean.BaseModel;
/**
* 直播间基类的参数回传
*/
public class OpenParametersModel extends BaseModel {
private String mDanmuPrice;//弹幕价格
private int mSocketUserType;//socket用户类型 30 普通用户 40 管理员 50 主播 60超管
private int mChatLevel;//发言等级限制
private int mDanMuLevel;//弹幕等级限制
//直播间的类型 普通 密码 门票 计时等
private int mLiveType = 0;
//收费价格,计时收费每次扣费的值
private int mLiveTypeVal = 0;
private LiveGuardInfo mLiveGuardInfo = null;
public int getmLiveType() {
return mLiveType;
}
public OpenParametersModel setmLiveType(int mLiveType) {
this.mLiveType = mLiveType;
return this;
}
public int getmLiveTypeVal() {
return mLiveTypeVal;
}
public OpenParametersModel setmLiveTypeVal(int mLiveTypeVal) {
this.mLiveTypeVal = mLiveTypeVal;
return this;
}
public LiveGuardInfo getmLiveGuardInfo() {
return mLiveGuardInfo;
}
public OpenParametersModel setmLiveGuardInfo(LiveGuardInfo mLiveGuardInfo) {
this.mLiveGuardInfo = mLiveGuardInfo;
return this;
}
public String getmDanmuPrice() {
return mDanmuPrice;
}
public OpenParametersModel setmDanmuPrice(String mDanmuPrice) {
this.mDanmuPrice = mDanmuPrice;
return this;
}
public int getmSocketUserType() {
return mSocketUserType;
}
public OpenParametersModel setmSocketUserType(int mSocketUserType) {
this.mSocketUserType = mSocketUserType;
return this;
}
public int getmChatLevel() {
return mChatLevel;
}
public OpenParametersModel setmChatLevel(int mChatLevel) {
this.mChatLevel = mChatLevel;
return this;
}
public int getmDanMuLevel() {
return mDanMuLevel;
}
public OpenParametersModel setmDanMuLevel(int mDanMuLevel) {
this.mDanMuLevel = mDanMuLevel;
return this;
}
}

View File

@ -1,4 +1,4 @@
package com.yunbao.common.dialog; package com.yunbao.live.dialog;
import android.os.Bundle; import android.os.Bundle;
import android.view.Gravity; import android.view.Gravity;
@ -9,14 +9,15 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R; import com.yunbao.common.R;
import com.yunbao.common.adapter.FunGamesAdapter; import com.yunbao.live.adapter.FunGamesAdapter;
import com.yunbao.common.bean.ActiveModel; import com.yunbao.common.bean.ActiveModel;
import com.yunbao.common.event.LiveAudienceEvent; import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.event.LiveAudienceEvent;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode; import org.greenrobot.eventbus.ThreadMode;

View File

@ -1,12 +1,23 @@
package com.yunbao.common.event; package com.yunbao.live.event;
import com.yunbao.common.bean.ActiveModel; import com.yunbao.common.bean.ActiveModel;
import com.yunbao.common.bean.BaseModel; import com.yunbao.common.bean.BaseModel;
import com.yunbao.live.bean.OpenParametersModel;
public class LiveAudienceEvent extends BaseModel { public class LiveAudienceEvent extends BaseModel {
private LiveAudienceType type; private LiveAudienceType type;
private ActiveModel model = new ActiveModel(); private ActiveModel model = new ActiveModel();
private String avatar = ""; private String avatar = "";
private OpenParametersModel parametersModel = new OpenParametersModel();
public OpenParametersModel getParametersModel() {
return parametersModel;
}
public LiveAudienceEvent setParametersModel(OpenParametersModel parametersModel) {
this.parametersModel = parametersModel;
return this;
}
public String getAvatar() { public String getAvatar() {
return avatar; return avatar;
@ -46,7 +57,8 @@ public class LiveAudienceEvent extends BaseModel {
NOBLE(8, "贵族"), NOBLE(8, "贵族"),
LIAN_MAI(9, "连麦"), LIAN_MAI(9, "连麦"),
EFFECTS_SETTINGS(10, "特效設置"), EFFECTS_SETTINGS(10, "特效設置"),
WISH_LIST(11, "心愿单"); WISH_LIST(11, "心愿单"),
OPEN_PARAMETERS(12, "开放参数");
private int type; private int type;

View File

@ -1,4 +1,4 @@
package com.yunbao.common.views; package com.yunbao.live.views;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
@ -9,10 +9,10 @@ import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.R; import com.yunbao.common.R;
import com.yunbao.common.bean.ActiveModel; import com.yunbao.common.bean.ActiveModel;
import com.yunbao.common.event.LiveAudienceEvent;
import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.Bus;
import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.live.event.LiveAudienceEvent;
public class FunGamesViewHolder extends RecyclerView.ViewHolder { public class FunGamesViewHolder extends RecyclerView.ViewHolder {
private ImageView funGamePic; private ImageView funGamePic;

View File

@ -33,7 +33,7 @@ import com.opensource.svgaplayer.SVGAVideoEntity;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.bean.MsgModel; import com.yunbao.common.bean.MsgModel;
import com.yunbao.common.event.LiveAudienceEvent; import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.common.event.MessageIMEvent; import com.yunbao.common.event.MessageIMEvent;
import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;

View File

@ -45,7 +45,7 @@ import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.bean.LevelBean; import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.bean.UserBean; import com.yunbao.common.bean.UserBean;
import com.yunbao.common.event.LiveAudienceEvent; import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.CommonHttpConsts; import com.yunbao.common.http.CommonHttpConsts;
import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.CommonHttpUtil;

View File

@ -4,22 +4,17 @@ import android.app.Activity;
import android.app.Dialog; import android.app.Dialog;
import android.content.Intent; import android.content.Intent;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.graphics.Outline;
import android.os.CountDownTimer; import android.os.CountDownTimer;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.Display;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.ViewOutlineProvider;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.ImageView; import android.widget.ImageView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout; import androidx.drawerlayout.widget.DrawerLayout;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.viewpager.widget.PagerAdapter; import androidx.viewpager.widget.PagerAdapter;
import com.adjust.sdk.Adjust; import com.adjust.sdk.Adjust;
@ -27,37 +22,28 @@ import com.adjust.sdk.AdjustEvent;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.GsonUtils; import com.blankj.utilcode.util.GsonUtils;
import com.ms.banner.Banner;
import com.tencent.imsdk.v2.V2TIMCallback; import com.tencent.imsdk.v2.V2TIMCallback;
import com.tencent.imsdk.v2.V2TIMManager; import com.tencent.imsdk.v2.V2TIMManager;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext; import com.yunbao.common.CommonAppContext;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.activity.WebViewActivity;
import com.yunbao.common.bean.AnchorRecommendModel;
import com.yunbao.common.bean.SlideInfoModel;
import com.yunbao.common.bean.UserBean; import com.yunbao.common.bean.UserBean;
import com.yunbao.common.custom.CommonRefreshView;
import com.yunbao.common.custom.ItemDecoration;
import com.yunbao.common.custom.MyViewPager; import com.yunbao.common.custom.MyViewPager;
import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.CommonHttpConsts; import com.yunbao.common.http.CommonHttpConsts;
import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.main.MainNetManager;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.DeviceUtils; import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.RandomUtil; import com.yunbao.common.utils.RandomUtil;
import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.utils.formatBigNum; import com.yunbao.common.utils.formatBigNum;
import com.yunbao.common.views.SlideInBannerViewHolder;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.adapter.SidebarAdapter;
import com.yunbao.live.bean.LiveBean; import com.yunbao.live.bean.LiveBean;
import com.yunbao.live.bean.LiveBuyGuardMsgBean; import com.yunbao.live.bean.LiveBuyGuardMsgBean;
import com.yunbao.live.bean.LiveChatBean; import com.yunbao.live.bean.LiveChatBean;
@ -69,16 +55,17 @@ import com.yunbao.live.bean.LiveLuckGiftWinBean;
import com.yunbao.live.bean.LivePKUserListBean; import com.yunbao.live.bean.LivePKUserListBean;
import com.yunbao.live.bean.LiveReceiveGiftBean; import com.yunbao.live.bean.LiveReceiveGiftBean;
import com.yunbao.live.bean.LiveUserGiftBean; import com.yunbao.live.bean.LiveUserGiftBean;
import com.yunbao.live.bean.OpenParametersModel;
import com.yunbao.live.bean.WishlistModel; import com.yunbao.live.bean.WishlistModel;
import com.yunbao.live.dialog.BlowkissDialog; import com.yunbao.live.dialog.BlowkissDialog;
import com.yunbao.live.dialog.NewUserDialog; import com.yunbao.live.dialog.NewUserDialog;
import com.yunbao.live.event.LinkMicTxAccEvent; import com.yunbao.live.event.LinkMicTxAccEvent;
import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpConsts;
import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.presenter.LiveLinkMicAnchorPresenter; import com.yunbao.live.presenter.LiveLinkMicAnchorPresenter;
import com.yunbao.live.presenter.LiveLinkMicPkPresenter; import com.yunbao.live.presenter.LiveLinkMicPkPresenter;
import com.yunbao.live.presenter.LiveLinkMicPresenter; import com.yunbao.live.presenter.LiveLinkMicPresenter;
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
import com.yunbao.live.presenter.LiveRyLinkMicPkPresenter; import com.yunbao.live.presenter.LiveRyLinkMicPkPresenter;
import com.yunbao.live.socket.SocketChatUtil; import com.yunbao.live.socket.SocketChatUtil;
import com.yunbao.live.socket.SocketClient; import com.yunbao.live.socket.SocketClient;
@ -209,6 +196,11 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveType = liveType; mLiveType = liveType;
mLiveTypeVal = liveTypeVal; mLiveTypeVal = liveTypeVal;
liveID = data.getUid(); liveID = data.getUid();
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS)
.setParametersModel(new OpenParametersModel()
.setmLiveType(mLiveType)
.setmLiveTypeVal(mLiveTypeVal)));
if (mIntent.getIntExtra("isry", 0) == 1) { if (mIntent.getIntExtra("isry", 0) == 1) {
mLivePlayViewHolder = new LivePlayRyViewHolder(mContext, playContainer, mIntent.getIntExtra("landscape", 0)); mLivePlayViewHolder = new LivePlayRyViewHolder(mContext, playContainer, mIntent.getIntExtra("landscape", 0));
} else { } else {
@ -841,7 +833,13 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mSocketUserType = obj.getIntValue("usertype"); mSocketUserType = obj.getIntValue("usertype");
mChatLevel = obj.getIntValue("speak_limit"); mChatLevel = obj.getIntValue("speak_limit");
mDanMuLevel = obj.getIntValue("barrage_limit"); mDanMuLevel = obj.getIntValue("barrage_limit");
//回传参数
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS)
.setParametersModel(new OpenParametersModel().setmDanmuPrice(mDanmuPrice)
.setmSocketUserType(mSocketUserType)
.setmChatLevel(mChatLevel)
.setmDanMuLevel(mDanMuLevel)));
EventBus.getDefault().post("close_login"); EventBus.getDefault().post("close_login");
EventBus.getDefault().post("oneUesrOver"); EventBus.getDefault().post("oneUesrOver");
@ -1028,6 +1026,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveGuardInfo.setMyGuardType(guardObj.getIntValue("type")); mLiveGuardInfo.setMyGuardType(guardObj.getIntValue("type"));
mLiveGuardInfo.setMyGuardEndTime(guardObj.getString("endtime")); mLiveGuardInfo.setMyGuardEndTime(guardObj.getString("endtime"));
} }
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS)
.setParametersModel(new OpenParametersModel().setmLiveGuardInfo(mLiveGuardInfo)));
if (mLiveRoomViewHolder != null) { if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.setGuardNum(guardNum); mLiveRoomViewHolder.setGuardNum(guardNum);
mLiveRoomViewHolder.setFansNum(fansNum); mLiveRoomViewHolder.setFansNum(fansNum);
@ -1098,9 +1099,6 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
} }
/** /**
* 暂停播放 * 暂停播放
*/ */