add[声望升级-多人PK]
This commit is contained in:
parent
7d46ab8520
commit
b4adf4c77c
@ -114,6 +114,17 @@ public class EnterRoomInfoModel extends BaseModel {
|
|||||||
@SerializedName("gift_wall_lighten_total")
|
@SerializedName("gift_wall_lighten_total")
|
||||||
private String giftWallLightenTotal;
|
private String giftWallLightenTotal;
|
||||||
|
|
||||||
|
@SerializedName("connection_info")
|
||||||
|
private LivePkMicModel connectionInfo;
|
||||||
|
|
||||||
|
public LivePkMicModel getConnectionInfo() {
|
||||||
|
return connectionInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConnectionInfo(LivePkMicModel connectionInfo) {
|
||||||
|
this.connectionInfo = connectionInfo;
|
||||||
|
}
|
||||||
|
|
||||||
public String getGiftWallLightenNumber() {
|
public String getGiftWallLightenNumber() {
|
||||||
return giftWallLightenNumber;
|
return giftWallLightenNumber;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,36 @@
|
|||||||
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class LivePkMicModel extends BaseModel {
|
||||||
|
@SerializedName("pkuid")
|
||||||
|
private String pkuid;
|
||||||
|
@SerializedName("pkuname")
|
||||||
|
private String pkuname;
|
||||||
|
@SerializedName("pkuimg")
|
||||||
|
private String pkuimg;
|
||||||
|
|
||||||
|
public String getPkuid() {
|
||||||
|
return pkuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPkuid(String pkuid) {
|
||||||
|
this.pkuid = pkuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPkuname() {
|
||||||
|
return pkuname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPkuname(String pkuname) {
|
||||||
|
this.pkuname = pkuname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPkuimg() {
|
||||||
|
return pkuimg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPkuimg(String pkuimg) {
|
||||||
|
this.pkuimg = pkuimg;
|
||||||
|
}
|
||||||
|
}
|
@ -232,7 +232,6 @@ public class SWAuManager extends BaseCacheManager {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退出对方直播间
|
* 退出对方直播间
|
||||||
* @param uid 自己的ID
|
* @param uid 自己的ID
|
||||||
@ -246,7 +245,11 @@ public class SWAuManager extends BaseCacheManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String getChannelName(String liveUid) {
|
public static String getChannelName(String liveUid) {
|
||||||
return CommonAppConfig.SWChannelPrefix + liveUid;
|
if(liveUid.contains("g")){
|
||||||
|
return liveUid;
|
||||||
|
}else{
|
||||||
|
return CommonAppConfig.SWChannelPrefix + liveUid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//远程监听
|
//远程监听
|
||||||
|
@ -218,7 +218,7 @@ public class SWManager extends BaseCacheManager {
|
|||||||
surfaceView.setZOrderMediaOverlay(true);
|
surfaceView.setZOrderMediaOverlay(true);
|
||||||
frameLayout.addView(surfaceView);
|
frameLayout.addView(surfaceView);
|
||||||
|
|
||||||
VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN, uid);
|
VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN , uid);
|
||||||
mRtcEngine.setupLocalVideo(videoCanvas);
|
mRtcEngine.setupLocalVideo(videoCanvas);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,7 +262,7 @@ public class SWManager extends BaseCacheManager {
|
|||||||
SurfaceView surfaceView = new SurfaceView(mContext);
|
SurfaceView surfaceView = new SurfaceView(mContext);
|
||||||
surfaceView.setZOrderMediaOverlay(true);
|
surfaceView.setZOrderMediaOverlay(true);
|
||||||
pkContainer.addView(surfaceView);
|
pkContainer.addView(surfaceView);
|
||||||
VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_FIT,Integer.parseInt(toUid));
|
VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN ,Integer.parseInt(toUid));
|
||||||
mRtcEngine.setupRemoteVideoEx(videoCanvas, rtcConnection);
|
mRtcEngine.setupRemoteVideoEx(videoCanvas, rtcConnection);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -310,6 +310,7 @@ public class SWManager extends BaseCacheManager {
|
|||||||
rtcConnection.channelId = channelName; //對方主播的頻道
|
rtcConnection.channelId = channelName; //對方主播的頻道
|
||||||
rtcConnection.localUid = tempUid;//自己的ID
|
rtcConnection.localUid = tempUid;//自己的ID
|
||||||
L.eSw("strUid:" + tempUid + "_token:" + token + "_channelName:" + channelName);
|
L.eSw("strUid:" + tempUid + "_token:" + token + "_channelName:" + channelName);
|
||||||
|
// 用内部通知,刷新多人PK的用户信息
|
||||||
mRtcEngine.joinChannelEx(token, rtcConnection, options, new IRtcEngineEventHandler() {
|
mRtcEngine.joinChannelEx(token, rtcConnection, options, new IRtcEngineEventHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void onJoinChannelSuccess(String channel, int scUid, int elapsed) {
|
public void onJoinChannelSuccess(String channel, int scUid, int elapsed) {
|
||||||
@ -321,7 +322,7 @@ public class SWManager extends BaseCacheManager {
|
|||||||
SurfaceView surfaceView = new SurfaceView(mContext);
|
SurfaceView surfaceView = new SurfaceView(mContext);
|
||||||
surfaceView.setZOrderMediaOverlay(true);
|
surfaceView.setZOrderMediaOverlay(true);
|
||||||
frameLayout.addView(surfaceView);
|
frameLayout.addView(surfaceView);
|
||||||
VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_FIT,Integer.parseInt(toUid));
|
VideoCanvas videoCanvas = new VideoCanvas(surfaceView, VideoCanvas.RENDER_MODE_HIDDEN ,Integer.parseInt(toUid));
|
||||||
mRtcEngine.setupRemoteVideoEx(videoCanvas, rtcConnection);
|
mRtcEngine.setupRemoteVideoEx(videoCanvas, rtcConnection);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -450,6 +451,10 @@ public class SWManager extends BaseCacheManager {
|
|||||||
this.linkUserContainer = linkUserContainer;
|
this.linkUserContainer = linkUserContainer;
|
||||||
}
|
}
|
||||||
public static String getChannelName(String liveUid) {
|
public static String getChannelName(String liveUid) {
|
||||||
return CommonAppConfig.SWChannelPrefix + liveUid;
|
if(liveUid.contains("g")){
|
||||||
|
return liveUid;
|
||||||
|
}else{
|
||||||
|
return CommonAppConfig.SWChannelPrefix + liveUid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -406,6 +406,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
|||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
|
LiveRyLinkMicPkPresenter.mApplyUid = CommonAppConfig.getInstance().getUid();
|
||||||
btn_start_dr_pk.setVisibility(View.VISIBLE);
|
btn_start_dr_pk.setVisibility(View.VISIBLE);
|
||||||
// dr_pk_view.setVisibility(View.VISIBLE);
|
// dr_pk_view.setVisibility(View.VISIBLE);
|
||||||
final SocketSendBean msg1 = new SocketSendBean()
|
final SocketSendBean msg1 = new SocketSendBean()
|
||||||
|
@ -112,7 +112,7 @@ public class LiveLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
mIsAnchor = isAnchor;
|
mIsAnchor = isAnchor;
|
||||||
mRoot = root;
|
mRoot = root;
|
||||||
mPkContainer = linkMicViewHolder.getPkContainer();
|
mPkContainer = linkMicViewHolder.getPkContainer();
|
||||||
mPkTimeString2 =mContext.getString(R.string.live_pk_time_2);
|
mPkTimeString2 = mContext.getString(R.string.live_pk_time_2);
|
||||||
|
|
||||||
//从本地取数据
|
//从本地取数据
|
||||||
String pkTime = CommonAppConfig.getInstance().getAnchorPkTime();
|
String pkTime = CommonAppConfig.getInstance().getAnchorPkTime();
|
||||||
@ -773,7 +773,8 @@ public class LiveLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
final SocketSendBean msg = new SocketSendBean()
|
final SocketSendBean msg = new SocketSendBean()
|
||||||
.param("_method_", Constants.SOCKET_LIVE_DRPK)
|
.param("_method_", Constants.SOCKET_LIVE_DRPK)
|
||||||
.param("action", 2)
|
.param("action", 2)
|
||||||
.param("uid", CommonAppConfig.getInstance().getUid());
|
.param("uid", u.getId())
|
||||||
|
.param("pkuid",CommonAppConfig.getInstance().getUid());
|
||||||
msg.create();
|
msg.create();
|
||||||
V2TIMManager.getInstance().sendC2CTextMessage(msg.mResult.toString(), list.get(i).getId() + "", new V2TIMSendCallback<V2TIMMessage>() {
|
V2TIMManager.getInstance().sendC2CTextMessage(msg.mResult.toString(), list.get(i).getId() + "", new V2TIMSendCallback<V2TIMMessage>() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -1022,42 +1022,68 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
drPkbeans.remove(removeIndex);
|
drPkbeans.remove(removeIndex);
|
||||||
L.eSw("将自己从多人pk列表里剔除" + new Gson().toJson(drPkbeans));
|
L.eSw("将自己从多人pk列表里剔除" + new Gson().toJson(drPkbeans));
|
||||||
}
|
}
|
||||||
for (int i = 0; i < drPkbeans.size(); i++) {
|
|
||||||
if (!CommonAppConfig.getInstance().getUid().equals(String.valueOf(drPkbeans.get(i).getId()))) {
|
|
||||||
final SocketSendBean msg1 = new SocketSendBean().param("_method_", SOCKET_LIVE_DRPK).param("action", 2).param("uname", CommonAppConfig.getInstance().getUserBean().getUserNiceName()).param("pkuid", drPkbeans.get(i).getId()).param("uid", CommonAppConfig.getInstance().getUid()).param("pkhead", CommonAppConfig.getInstance().getUserBean().getAvatar()).param("pkname", CommonAppConfig.getInstance().getUserBean().getUserNiceName());
|
|
||||||
msg1.create();
|
|
||||||
|
|
||||||
String targetId = "g" + drPkbeans.get(i).getId();
|
HttpClient.getInstance().get("Live.getDRPKroom", "Live.getDRPKroom").params("uid", CommonAppConfig.getInstance().getUid()).params("roomid", mApplyUid).execute(new HttpCallback() {
|
||||||
Conversation.ConversationType conversationType = Conversation.ConversationType.CHATROOM;
|
@Override
|
||||||
TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString());
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(targetId, conversationType, messageContent);
|
if (info.length > 0) {
|
||||||
|
JSONObject obj = JSONObject.parseObject(info[0]);
|
||||||
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
drPkbeans = JSONObject.parseArray(obj.getString("userlist"), DrPkbean.class);
|
||||||
@Override
|
int removeIndex = -1;
|
||||||
public void onAttached(io.rong.imlib.model.Message message) {
|
for (int i = 0; i < drPkbeans.size(); i++) {
|
||||||
|
if (CommonAppConfig.getInstance().getUid().equals(String.valueOf(drPkbeans.get(i).getId()))) {
|
||||||
}
|
removeIndex = i;
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(io.rong.imlib.model.Message message) {
|
|
||||||
if (SocketRyClient.mSocketHandler != null) {
|
|
||||||
SocketRyClient.mSocketHandler.processBroadcast(msg1.mResult.toString() + "");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (removeIndex != -1) {
|
||||||
@Override
|
drPkbeans.remove(removeIndex);
|
||||||
public void onError(io.rong.imlib.model.Message message, RongIMClient.ErrorCode errorCode) {
|
|
||||||
Log.e("tx", "aaa" + errorCode.toString());
|
|
||||||
ToastUtil.show(errorCode.code + ":" + errorCode.msg);
|
|
||||||
}
|
}
|
||||||
});
|
for (int i = 0; i <drPkbeans.size(); i++) {
|
||||||
//
|
if (!CommonAppConfig.getInstance().getUid().equals(String.valueOf(drPkbeans.get(i).getId()))) {
|
||||||
int index = livePushRyViewHolder.setAnDrPkRtc(String.valueOf(drPkbeans.get(i).getId()), -1);
|
final SocketSendBean msg1 = new SocketSendBean().param("_method_", SOCKET_LIVE_DRPK)
|
||||||
L.eSw("onLinkDRMicPkApplyOk(UserBean u)-点击接收 " + u.getUserNiceName());
|
.param("action", 2)
|
||||||
|
.param("uname", CommonAppConfig.getInstance().getUserBean().getUserNiceName())
|
||||||
|
.param("pkuid", CommonAppConfig.getInstance().getUid())
|
||||||
|
.param("uid", drPkbeans.get(i).getId())
|
||||||
|
.param("pkhead", CommonAppConfig.getInstance().getUserBean().getAvatar())
|
||||||
|
.param("pkname", CommonAppConfig.getInstance().getUserBean().getUserNiceName());
|
||||||
|
msg1.create();
|
||||||
|
|
||||||
|
String targetId = "g" + drPkbeans.get(i).getId();
|
||||||
|
Conversation.ConversationType conversationType = Conversation.ConversationType.CHATROOM;
|
||||||
|
TextMessage messageContent = TextMessage.obtain(msg1.mResult.toString());
|
||||||
|
io.rong.imlib.model.Message message = io.rong.imlib.model.Message.obtain(targetId, conversationType, messageContent);
|
||||||
|
|
||||||
|
RongIMClient.getInstance().sendMessage(message, null, null, new IRongCallback.ISendMessageCallback() {
|
||||||
|
@Override
|
||||||
|
public void onAttached(io.rong.imlib.model.Message message) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(io.rong.imlib.model.Message message) {
|
||||||
|
if (SocketRyClient.mSocketHandler != null) {
|
||||||
|
SocketRyClient.mSocketHandler.processBroadcast(msg1.mResult.toString() + "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(io.rong.imlib.model.Message message, RongIMClient.ErrorCode errorCode) {
|
||||||
|
Log.e("tx", "aaa" + errorCode.toString());
|
||||||
|
ToastUtil.show(errorCode.code + ":" + errorCode.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//
|
||||||
|
int index = livePushRyViewHolder.setAnDrPkRtc(String.valueOf(drPkbeans.get(i).getId()), -1);
|
||||||
|
L.eSw("onLinkDRMicPkApplyOk(UserBean u)-点击接收 " + u.getUserNiceName());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dRjoinOtherRoom(u);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
dRjoinOtherRoom(u);
|
|
||||||
|
|
||||||
/*for (int i = 0; i < users.size(); i++) {
|
/*for (int i = 0; i < users.size(); i++) {
|
||||||
JSONObject user = users.getJSONObject(i);
|
JSONObject user = users.getJSONObject(i);
|
||||||
@ -1221,7 +1247,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
setMyDrPkDetailsView();
|
setMyDrPkDetailsView();
|
||||||
isShow = true;
|
isShow = true;
|
||||||
}
|
}
|
||||||
HttpClient.getInstance().get("Live.getDRPKroom", "Live.getDRPKroom").params("uid", CommonAppConfig.getInstance().getUid()).params("roomid", u.getId()).execute(new HttpCallback() {
|
HttpClient.getInstance().get("Live.getDRPKroom", "Live.getDRPKroom").params("uid", CommonAppConfig.getInstance().getUid()).params("roomid", mApplyUid).execute(new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
if (info.length > 0) {
|
if (info.length > 0) {
|
||||||
@ -1235,7 +1261,6 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
}
|
}
|
||||||
if (removeIndex != -1) {
|
if (removeIndex != -1) {
|
||||||
drPkbeans.remove(removeIndex);
|
drPkbeans.remove(removeIndex);
|
||||||
L.eSw("将自己从多人pk列表里剔除" + new Gson().toJson(drPkbeans));
|
|
||||||
}
|
}
|
||||||
setDrPkUserInfoView(drPkbeans);
|
setDrPkUserInfoView(drPkbeans);
|
||||||
}
|
}
|
||||||
@ -1244,74 +1269,84 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setDrPkUserInfoView(List<DrPkbean> drPkbeanList) {
|
private void setDrPkUserInfoView(List<DrPkbean> drPkbeanList) {
|
||||||
for (int j = 0; j <drPkbeanList.size(); j++) {
|
L.eSw("setDrPkUserInfoView"+new Gson().toJson(drPkbeanList));
|
||||||
if (j == 0) {
|
mHandler.postDelayed(new Runnable() {
|
||||||
//设置多人PK数据
|
@Override
|
||||||
if (detailsView2 != null) {
|
public void run() {
|
||||||
livePushRyViewHolder.dr2_preview.removeView(detailsView2);
|
for (int j = 0; j <drPkbeanList.size(); j++) {
|
||||||
}
|
if (j == 0) {
|
||||||
detailsView2 = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
L.eSw("j == 0:"+j);
|
||||||
detailsLinearLayout2 = detailsView2.findViewById(R.id.lin_pk2);
|
//设置多人PK数据
|
||||||
linearGrade2 = detailsView2.findViewById(R.id.linear_grade2);
|
if (detailsView2 != null) {
|
||||||
textPkName2 = detailsView2.findViewById(R.id.text_pk_name2);
|
livePushRyViewHolder.dr2_preview.removeView(detailsView2);
|
||||||
imageGrade2 = detailsView2.findViewById(R.id.image_grade2);
|
}
|
||||||
textGrade2 = detailsView2.findViewById(R.id.text_grade2);
|
detailsView2 = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
||||||
imageGrade2.setTag(String.valueOf(drPkbeanList.get(0).getId()));
|
detailsLinearLayout2 = detailsView2.findViewById(R.id.lin_pk2);
|
||||||
textPkName2.setText(drPkbeanList.get(0).getUser_nicename());
|
linearGrade2 = detailsView2.findViewById(R.id.linear_grade2);
|
||||||
livePushRyViewHolder.dr2_preview.addView(detailsView2);
|
textPkName2 = detailsView2.findViewById(R.id.text_pk_name2);
|
||||||
detailsLinearLayout2.setVisibility(View.VISIBLE);
|
imageGrade2 = detailsView2.findViewById(R.id.image_grade2);
|
||||||
linearGrade2.setVisibility(View.GONE);
|
textGrade2 = detailsView2.findViewById(R.id.text_grade2);
|
||||||
} else if (j == 1) {
|
imageGrade2.setTag(String.valueOf(drPkbeanList.get(0).getId()));
|
||||||
if (detailsView4 != null) {
|
textPkName2.setText(drPkbeanList.get(0).getUser_nicename());
|
||||||
livePushRyViewHolder.dr4_preview.removeView(detailsView4);
|
livePushRyViewHolder.dr2_preview.addView(detailsView2);
|
||||||
}
|
detailsLinearLayout2.setVisibility(View.VISIBLE);
|
||||||
detailsView4 = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
linearGrade2.setVisibility(View.GONE);
|
||||||
detailsLinearLayout4 = detailsView4.findViewById(R.id.lin_pk4);
|
} else if (j == 1) {
|
||||||
linearGrade4 = detailsView4.findViewById(R.id.linear_grade4);
|
L.eSw("j == 1:"+j);
|
||||||
textPkName4 = detailsView4.findViewById(R.id.text_pk_name4);
|
if (detailsView4 != null) {
|
||||||
imageGrade4 = detailsView4.findViewById(R.id.image_grade4);
|
livePushRyViewHolder.dr4_preview.removeView(detailsView4);
|
||||||
textGrade4 = detailsView4.findViewById(R.id.text_grade4);
|
}
|
||||||
imageGrade4.setTag(String.valueOf(drPkbeanList.get(1).getId()));
|
detailsView4 = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
||||||
textPkName4.setText(drPkbeanList.get(1).getUser_nicename());
|
detailsLinearLayout4 = detailsView4.findViewById(R.id.lin_pk4);
|
||||||
livePushRyViewHolder.dr4_preview.addView(detailsView4);
|
linearGrade4 = detailsView4.findViewById(R.id.linear_grade4);
|
||||||
detailsLinearLayout4.setVisibility(View.VISIBLE);
|
textPkName4 = detailsView4.findViewById(R.id.text_pk_name4);
|
||||||
linearGrade4.setVisibility(View.GONE);
|
imageGrade4 = detailsView4.findViewById(R.id.image_grade4);
|
||||||
} else if (j == 2) {
|
textGrade4 = detailsView4.findViewById(R.id.text_grade4);
|
||||||
//设置多人PK数据
|
imageGrade4.setTag(String.valueOf(drPkbeanList.get(1).getId()));
|
||||||
if (detailsView3 != null) {
|
textPkName4.setText(drPkbeanList.get(1).getUser_nicename());
|
||||||
livePushRyViewHolder.dr3_preview.removeView(detailsView3);
|
livePushRyViewHolder.dr4_preview.addView(detailsView4);
|
||||||
}
|
detailsLinearLayout4.setVisibility(View.VISIBLE);
|
||||||
detailsView3 = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
linearGrade4.setVisibility(View.GONE);
|
||||||
detailsLinearLayout3 = detailsView3.findViewById(R.id.lin_pk3);
|
} else if (j == 2) {
|
||||||
linearGrade3 = detailsView3.findViewById(R.id.linear_grade3);
|
L.eSw("j == 2:"+j);
|
||||||
textPkName3 = detailsView3.findViewById(R.id.text_pk_name3);
|
|
||||||
imageGrade3 = detailsView3.findViewById(R.id.image_grade3);
|
|
||||||
textGrade3 = detailsView3.findViewById(R.id.text_grade3);
|
|
||||||
imageGrade3.setTag(String.valueOf(drPkbeanList.get(1).getId()));
|
|
||||||
textPkName3.setText(drPkbeanList.get(1).getUser_nicename());
|
|
||||||
livePushRyViewHolder.dr3_preview.addView(detailsView3);
|
|
||||||
detailsLinearLayout3.setVisibility(View.VISIBLE);
|
|
||||||
linearGrade3.setVisibility(View.GONE);
|
|
||||||
|
|
||||||
if (detailsView4 != null) {
|
if (detailsView4 != null) {
|
||||||
livePushRyViewHolder.dr4_preview.removeView(detailsView4);
|
livePushRyViewHolder.dr4_preview.removeView(detailsView4);
|
||||||
|
}
|
||||||
|
detailsView4 = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
||||||
|
detailsLinearLayout4 = detailsView4.findViewById(R.id.lin_pk4);
|
||||||
|
linearGrade4 = detailsView4.findViewById(R.id.linear_grade4);
|
||||||
|
textPkName4 = detailsView4.findViewById(R.id.text_pk_name4);
|
||||||
|
imageGrade4 = detailsView4.findViewById(R.id.image_grade4);
|
||||||
|
textGrade4 = detailsView4.findViewById(R.id.text_grade4);
|
||||||
|
imageGrade4.setTag(String.valueOf(drPkbeanList.get(2).getId()));
|
||||||
|
textPkName4.setText(drPkbeanList.get(2).getUser_nicename());
|
||||||
|
livePushRyViewHolder.dr4_preview.addView(detailsView4);
|
||||||
|
detailsLinearLayout4.setVisibility(View.VISIBLE);
|
||||||
|
linearGrade4.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
if (detailsView3 != null) {
|
||||||
|
livePushRyViewHolder.dr3_preview.removeView(detailsView3);
|
||||||
|
}
|
||||||
|
detailsView3 = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
||||||
|
detailsLinearLayout3 = detailsView3.findViewById(R.id.lin_pk3);
|
||||||
|
linearGrade3 = detailsView3.findViewById(R.id.linear_grade3);
|
||||||
|
textPkName3 = detailsView3.findViewById(R.id.text_pk_name3);
|
||||||
|
imageGrade3 = detailsView3.findViewById(R.id.image_grade3);
|
||||||
|
textGrade3 = detailsView3.findViewById(R.id.text_grade3);
|
||||||
|
imageGrade3.setTag(String.valueOf(drPkbeanList.get(1).getId()));
|
||||||
|
textPkName3.setText(drPkbeanList.get(1).getUser_nicename());
|
||||||
|
livePushRyViewHolder.dr3_preview.addView(detailsView3);
|
||||||
|
detailsLinearLayout3.setVisibility(View.VISIBLE);
|
||||||
|
linearGrade3.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
|
||||||
|
ToastUtil.show(WordUtil.isNewZh() ? "接受成功" : "Success");
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
detailsView4 = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
|
||||||
detailsLinearLayout4 = detailsView4.findViewById(R.id.lin_pk4);
|
|
||||||
linearGrade4 = detailsView4.findViewById(R.id.linear_grade4);
|
|
||||||
textPkName4 = detailsView4.findViewById(R.id.text_pk_name4);
|
|
||||||
imageGrade4 = detailsView4.findViewById(R.id.image_grade4);
|
|
||||||
textGrade4 = detailsView4.findViewById(R.id.text_grade4);
|
|
||||||
imageGrade4.setTag(String.valueOf(drPkbeanList.get(2).getId()));
|
|
||||||
textPkName4.setText(drPkbeanList.get(2).getUser_nicename());
|
|
||||||
livePushRyViewHolder.dr4_preview.addView(detailsView4);
|
|
||||||
detailsLinearLayout4.setVisibility(View.VISIBLE);
|
|
||||||
linearGrade4.setVisibility(View.GONE);
|
|
||||||
|
|
||||||
ToastUtil.show(WordUtil.isNewZh() ? "接受成功" : "Success");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
},1000);
|
||||||
L.eSw("dRjoinOtherRoom:size:" + drPkbeanList.size() + " json " + new Gson().toJson(drPkbeanList));
|
L.eSw("dRjoinOtherRoom:size:" + drPkbeanList.size() + " json " + new Gson().toJson(drPkbeanList));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.blankj.utilcode.util.GsonUtils;
|
import com.blankj.utilcode.util.GsonUtils;
|
||||||
|
import com.google.gson.Gson;
|
||||||
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;
|
||||||
@ -216,8 +217,7 @@ public class SocketRyClient {
|
|||||||
EventBus.getDefault().post("endMic");
|
EventBus.getDefault().post("endMic");
|
||||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.LINK_MIC_CLOSE).setObject(map.toJavaObject(LinkMicUserBean.class)));
|
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.LINK_MIC_CLOSE).setObject(map.toJavaObject(LinkMicUserBean.class)));
|
||||||
} else if (actions == 8) {
|
} else if (actions == 8) {
|
||||||
//踢下麥
|
//提下買,退出
|
||||||
|
|
||||||
if (WordUtil.isNewZh()) {
|
if (WordUtil.isNewZh()) {
|
||||||
ToastUtil.show("您已被移出多人語音連麥");
|
ToastUtil.show("您已被移出多人語音連麥");
|
||||||
} else {
|
} else {
|
||||||
@ -302,6 +302,7 @@ public class SocketRyClient {
|
|||||||
// break;
|
// break;
|
||||||
case Constants.SOCKET_LIVE_DRPK_RANDOM:
|
case Constants.SOCKET_LIVE_DRPK_RANDOM:
|
||||||
case Constants.SOCKET_LIVE_DRPK://多人PK
|
case Constants.SOCKET_LIVE_DRPK://多人PK
|
||||||
|
L.eSw("map"+new Gson().toJson(map));
|
||||||
int action3 = map.getIntValue("action");
|
int action3 = map.getIntValue("action");
|
||||||
//收到多人PK邀请
|
//收到多人PK邀请
|
||||||
if (action3 == 1) {
|
if (action3 == 1) {
|
||||||
@ -314,7 +315,7 @@ public class SocketRyClient {
|
|||||||
else if (action3 == 2) {
|
else if (action3 == 2) {
|
||||||
UserBean u = new UserBean();
|
UserBean u = new UserBean();
|
||||||
// u.setUserNiceName(map.getString("uname"));
|
// u.setUserNiceName(map.getString("uname"));
|
||||||
u.setId(map.getString("uid"));
|
u.setId(map.getString("pkuid"));
|
||||||
L.eSw("action3 == 2:"+u.getId());
|
L.eSw("action3 == 2:"+u.getId());
|
||||||
mListener.onLinkDRMicPkApplyOk(u);
|
mListener.onLinkDRMicPkApplyOk(u);
|
||||||
} else if (action3 == 6) {//开始Pk
|
} else if (action3 == 6) {//开始Pk
|
||||||
|
@ -208,55 +208,65 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 开启单人PK
|
* 开启单人PK
|
||||||
|
*
|
||||||
* @param Uid
|
* @param Uid
|
||||||
*/
|
*/
|
||||||
public void setPkView(String Uid) {
|
public void setPkView(String Uid) {
|
||||||
|
L.eSw("setPkView Uid "+Uid);
|
||||||
|
mPkContainer.setVisibility(View.VISIBLE);
|
||||||
swAuManager.updateMyChannelView((FrameLayout) mLeftContainer, Integer.parseInt(liveUid));
|
swAuManager.updateMyChannelView((FrameLayout) mLeftContainer, Integer.parseInt(liveUid));
|
||||||
ry_view.removeAllViews();
|
ry_view.removeAllViews();
|
||||||
//加入对方主播房间
|
//加入对方主播房间
|
||||||
swAuManager.setPkContainer1((FrameLayout) mRightContainer);
|
swAuManager.setPkContainer1((FrameLayout) mRightContainer);
|
||||||
swAuManager.joinExRoomEx(Integer.parseInt(Uid), CommonAppConfig.SWToken, SWAuManager.getChannelName(Uid));
|
swAuManager.joinExRoomEx(Integer.parseInt(Uid), CommonAppConfig.SWToken, SWAuManager.getChannelName(Uid));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<UserBean> drMicUserList = new ArrayList<>();
|
List<UserBean> drMicUserList = new ArrayList<>();
|
||||||
|
|
||||||
boolean isAdd = true;
|
boolean isAdd = true;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setDrMicInfo(UserBean u) {
|
public void setDrMicInfo(UserBean u) {
|
||||||
L.eSw("setDrMicInfo:"+u.getId()+" drMicUserList:"+new Gson().toJson(drMicUserList));
|
L.eSw("setDrMicInfo:-----------------" + u.getId());
|
||||||
for (int i = 0; i <drMicUserList.size(); i++) {
|
for (int i = 0; i < drMicUserList.size(); i++) {
|
||||||
if(u.getId().equals(drMicUserList.get(i).getId())){
|
if (u.getId().equals(drMicUserList.get(i).getId())) {
|
||||||
isAdd = false;
|
isAdd = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//加载多人PK(连麦)主播视图
|
//加载多人PK(连麦)主播视图
|
||||||
if(isAdd){
|
if (isAdd) {
|
||||||
dr_pk_view.setVisibility(View.VISIBLE);
|
dr_pk_view.setVisibility(View.VISIBLE);
|
||||||
drMicUserList.add(u);
|
drMicUserList.add(u);
|
||||||
if(drMicUserList.size()==1){
|
if (drMicUserList.size() == 1) {
|
||||||
|
L.eSw("setDrMicInfo:-----------------drMicUserList.size() == 1");
|
||||||
ry_view.removeAllViews();
|
ry_view.removeAllViews();
|
||||||
swAuManager.updateMyChannelView((FrameLayout) dr1_preview, Integer.parseInt(liveUid));
|
swAuManager.updateMyChannelView((FrameLayout) dr1_preview, Integer.parseInt(liveUid));
|
||||||
swAuManager.joinChannelDrEx(dr2_preview,CommonAppConfig.getInstance().getUid(),CommonAppConfig.SWToken, u.getId(),SWAuManager.getChannelName(u.getId()));
|
swAuManager.joinChannelDrEx(dr2_preview, CommonAppConfig.getInstance().getUid(), CommonAppConfig.SWToken, u.getId(), SWAuManager.getChannelName(u.getId()));
|
||||||
|
dr2_preview.setVisibility(View.VISIBLE);
|
||||||
dr3_preview.setVisibility(View.GONE);
|
dr3_preview.setVisibility(View.GONE);
|
||||||
dr4_preview.setVisibility(View.GONE);
|
dr4_preview.setVisibility(View.GONE);
|
||||||
}else if(drMicUserList.size()==2){
|
} else if (drMicUserList.size() == 2) {
|
||||||
dr3_preview.setVisibility(View.GONE);
|
L.eSw("setDrMicInfo:-----------------drMicUserList.size() == 2");
|
||||||
dr4_preview.setVisibility(View.VISIBLE);
|
dr4_preview.setVisibility(View.VISIBLE);
|
||||||
swAuManager.joinChannelDrEx(dr4_preview,CommonAppConfig.getInstance().getUid(),CommonAppConfig.SWToken, u.getId(),SWAuManager.getChannelName(u.getId()));
|
swAuManager.joinChannelDrEx(dr4_preview, CommonAppConfig.getInstance().getUid(), CommonAppConfig.SWToken, u.getId(), SWAuManager.getChannelName(u.getId()));
|
||||||
}else if(drMicUserList.size()==3){
|
} else if (drMicUserList.size() == 3) {
|
||||||
|
L.eSw("setDrMicInfo:-----------------drMicUserList.size() == 3");
|
||||||
dr4_preview.setVisibility(View.VISIBLE);
|
dr4_preview.setVisibility(View.VISIBLE);
|
||||||
swAuManager.exitChannelToUid(Integer.parseInt(CommonAppConfig.getInstance().getUid()),drMicUserList.get(1).getId());
|
dr3_preview.setVisibility(View.VISIBLE);
|
||||||
swAuManager.joinChannelDrEx(dr3_preview,CommonAppConfig.getInstance().getUid(),CommonAppConfig.SWToken, drMicUserList.get(1).getId(),SWAuManager.getChannelName(drMicUserList.get(1).getId()));
|
swAuManager.exitChannelToUid(Integer.parseInt(CommonAppConfig.getInstance().getUid()), drMicUserList.get(1).getId());
|
||||||
swAuManager.joinChannelDrEx(dr4_preview,CommonAppConfig.getInstance().getUid(),CommonAppConfig.SWToken, drMicUserList.get(2).getId(),SWAuManager.getChannelName(drMicUserList.get(2).getId()));
|
swAuManager.joinChannelDrEx(dr3_preview, CommonAppConfig.getInstance().getUid(), CommonAppConfig.SWToken, drMicUserList.get(1).getId(), SWAuManager.getChannelName(drMicUserList.get(1).getId()));
|
||||||
|
swAuManager.joinChannelDrEx(dr4_preview, CommonAppConfig.getInstance().getUid(), CommonAppConfig.SWToken, drMicUserList.get(2).getId(), SWAuManager.getChannelName(drMicUserList.get(2).getId()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退出单人pk
|
* 退出单人pk
|
||||||
|
*
|
||||||
* @param pkUid
|
* @param pkUid
|
||||||
*/
|
*/
|
||||||
public void endpk(String pkUid) {
|
public void endpk(String pkUid) {
|
||||||
|
mPkContainer.setVisibility(View.GONE);
|
||||||
swAuManager.exitChannelToUid(Integer.parseInt(CommonAppConfig.getInstance().getUid()), SWAuManager.getChannelName(pkUid));
|
swAuManager.exitChannelToUid(Integer.parseInt(CommonAppConfig.getInstance().getUid()), SWAuManager.getChannelName(pkUid));
|
||||||
swAuManager.updateMyChannelView(ry_view, Integer.parseInt(liveUid));
|
swAuManager.updateMyChannelView(ry_view, Integer.parseInt(liveUid));
|
||||||
mLeftContainer.removeAllViews();
|
mLeftContainer.removeAllViews();
|
||||||
@ -266,15 +276,19 @@ boolean isAdd = true;
|
|||||||
/**
|
/**
|
||||||
* 退出所有连麦主播的房間
|
* 退出所有连麦主播的房間
|
||||||
*/
|
*/
|
||||||
public void endPk(){
|
public void endPk() {
|
||||||
dr_pk_view.setVisibility(View.GONE);
|
dr_pk_view.setVisibility(View.GONE);
|
||||||
|
dr1_preview.setVisibility(View.GONE);
|
||||||
|
dr2_preview.setVisibility(View.GONE);
|
||||||
|
dr3_preview.setVisibility(View.GONE);
|
||||||
|
dr4_preview.setVisibility(View.GONE);
|
||||||
dr1_preview.removeAllViews();
|
dr1_preview.removeAllViews();
|
||||||
dr2_preview.removeAllViews();
|
dr2_preview.removeAllViews();
|
||||||
dr3_preview.removeAllViews();
|
dr3_preview.removeAllViews();
|
||||||
dr4_preview.removeAllViews();
|
dr4_preview.removeAllViews();
|
||||||
//退出所有连麦主播的房間
|
//退出所有连麦主播的房間
|
||||||
for (int i = 0; i <drMicUserList.size(); i++) {
|
for (int i = 0; i < drMicUserList.size(); i++) {
|
||||||
swAuManager.exitChannelToUid(Integer.parseInt(CommonAppConfig.getInstance().getUid()),drMicUserList.get(i).getId());
|
swAuManager.exitChannelToUid(Integer.parseInt(CommonAppConfig.getInstance().getUid()), drMicUserList.get(i).getId());
|
||||||
}
|
}
|
||||||
//將當前主播畫面放大
|
//將當前主播畫面放大
|
||||||
swAuManager.updateMyChannelView((FrameLayout) ry_view, Integer.parseInt(liveUid));
|
swAuManager.updateMyChannelView((FrameLayout) ry_view, Integer.parseInt(liveUid));
|
||||||
@ -285,17 +299,15 @@ boolean isAdd = true;
|
|||||||
*/
|
*/
|
||||||
private void joinLiveMic() {
|
private void joinLiveMic() {
|
||||||
L.eSw("joinLiveMic");
|
L.eSw("joinLiveMic");
|
||||||
HttpClient.getInstance().get("live.joinDrLm", "live.joinDrLm")
|
HttpClient.getInstance().get("live.joinDrLm", "live.joinDrLm").params("roomid", LiveActivity.mLiveUid).execute(new HttpCallback() {
|
||||||
.params("roomid", LiveActivity.mLiveUid)
|
@Override
|
||||||
.execute(new HttpCallback() {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
@Override
|
Log.e("ry", code + "热热热");
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
if (code == 0) {
|
||||||
Log.e("ry", code + "热热热");
|
swAuManager.setMicAn(true);
|
||||||
if(code==0){
|
}
|
||||||
swAuManager.setMicAn(true);
|
}
|
||||||
}
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void endLiveMic() {
|
private void endLiveMic() {
|
||||||
@ -801,10 +813,10 @@ boolean isAdd = true;
|
|||||||
builder.build().show();
|
builder.build().show();
|
||||||
|
|
||||||
} else if ("endMic".equals(str)) {
|
} else if ("endMic".equals(str)) {
|
||||||
L.eSw("endMic.equals(str))"+str);
|
L.eSw("endMic.equals(str))" + str);
|
||||||
// 开始切换为观众身份
|
// 开始切换为观众身份
|
||||||
//声网-将用户身份切换只观众
|
//声网-将用户身份切换只观众
|
||||||
endLiveMic();
|
endLiveMic();
|
||||||
} else if ("Debug".equals(str)) {
|
} else if ("Debug".equals(str)) {
|
||||||
if (EasyFloat.isShow("Debug")) {
|
if (EasyFloat.isShow("Debug")) {
|
||||||
EasyFloat.dismiss("Debug");
|
EasyFloat.dismiss("Debug");
|
||||||
@ -912,7 +924,7 @@ boolean isAdd = true;
|
|||||||
setPkView(pkUid);
|
setPkView(pkUid);
|
||||||
} else if (event.getType() == LiveAudienceEvent.LiveAudienceType.LIVE_PK_END) {
|
} else if (event.getType() == LiveAudienceEvent.LiveAudienceType.LIVE_PK_END) {
|
||||||
String pkUid = (String) event.getObject();
|
String pkUid = (String) event.getObject();
|
||||||
//endpk(pkUid);
|
//endpk(pkUid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -583,12 +583,14 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
SWManager.get().updateMyChannelView((FrameLayout) mBigContainer);
|
SWManager.get().updateMyChannelView((FrameLayout) mBigContainer);
|
||||||
|
currentPosition = 0;
|
||||||
|
drpkUid3 = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAnPkRtc(UserBean u) {
|
public void setAnPkRtc(UserBean u) {
|
||||||
if (swManager != null && u != null) {
|
if (swManager != null && u != null) {
|
||||||
L.eSw("设置对方主播的视图setAnPkRtc" + u);
|
L.eSw("设置对方主播的视图setAnPkRtc" + u);
|
||||||
|
mPkContainer.setVisibility(View.VISIBLE);
|
||||||
//将自己的渲染视图设置到 leftContainer
|
//将自己的渲染视图设置到 leftContainer
|
||||||
swManager.updateMyChannelView((FrameLayout) mLeftContainer);
|
swManager.updateMyChannelView((FrameLayout) mLeftContainer);
|
||||||
//清除 mBigContainer 中的渲染
|
//清除 mBigContainer 中的渲染
|
||||||
|
@ -5276,7 +5276,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
public void upDataPkScore(JSONArray pkScores, int time) {
|
public void upDataPkScore(JSONArray pkScores, int time) {
|
||||||
L.eSw("upDataPkScore(JSONArray pkScores, int time) {"+new Gson().toJson(pkScores));
|
L.eSw("upDataPkScore(JSONArray pkScores, int time) {"+new Gson().toJson(pkScores));
|
||||||
isShowGif = true;
|
isShowGif = true;
|
||||||
/*if (detailsView == null) {
|
if (detailsView == null) {
|
||||||
L.eSw("upDataPkScore(JSONArray pkScores, int time) {detailsView=null");
|
L.eSw("upDataPkScore(JSONArray pkScores, int time) {detailsView=null");
|
||||||
detailsView = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
detailsView = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
||||||
timeTitle = detailsView.findViewById(R.id.time_title);
|
timeTitle = detailsView.findViewById(R.id.time_title);
|
||||||
@ -5316,7 +5316,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
detailsView.setLayoutParams(params);
|
detailsView.setLayoutParams(params);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}*/
|
}
|
||||||
if (time > 0) {
|
if (time > 0) {
|
||||||
mPkTimeCount2 = time;
|
mPkTimeCount2 = time;
|
||||||
drPKtIME = time;
|
drPKtIME = time;
|
||||||
|
@ -38,6 +38,7 @@ import com.yunbao.common.bean.BannerBean;
|
|||||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||||
import com.yunbao.common.bean.EnterRoomNewModel;
|
import com.yunbao.common.bean.EnterRoomNewModel;
|
||||||
import com.yunbao.common.bean.LiveBean;
|
import com.yunbao.common.bean.LiveBean;
|
||||||
|
import com.yunbao.common.bean.LivePkMicModel;
|
||||||
import com.yunbao.common.bean.LiveRoomActivityModel;
|
import com.yunbao.common.bean.LiveRoomActivityModel;
|
||||||
import com.yunbao.common.bean.LiveUserGiftBean;
|
import com.yunbao.common.bean.LiveUserGiftBean;
|
||||||
import com.yunbao.common.bean.MsgModel;
|
import com.yunbao.common.bean.MsgModel;
|
||||||
@ -644,17 +645,22 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
if(mLivePlayViewHolder != null && data.getEnterRoomInfo().getIsconnection() != null && data.getEnterRoomInfo().getIsconnection().equals("1")){
|
if(mLivePlayViewHolder != null && data.getEnterRoomInfo().getIsconnection() != null && data.getEnterRoomInfo().getIsconnection().equals("1")){
|
||||||
JSONArray array = pkInfo.getJSONArray("userlist");
|
JSONArray array = pkInfo.getJSONArray("userlist");
|
||||||
//判断是否是多人连麦
|
//判断是否是多人连麦
|
||||||
if(array!=null){//多人連麥
|
if(array.size()>0){//多人連麥
|
||||||
if (mLivePlayViewHolder != null) {
|
if (mLivePlayViewHolder != null) {
|
||||||
for (int j = 0; j < array.size(); j++) {
|
for (int j = 0; j < array.size(); j++) {
|
||||||
UserBean drPkbean = new UserBean();
|
UserBean drPkbean = new UserBean();
|
||||||
JSONObject da = array.getJSONObject(j);
|
JSONObject da = array.getJSONObject(j);
|
||||||
drPkbean.setId(String.valueOf(da.getIntValue("id")));
|
if(!String.valueOf(da.getIntValue("id")).equals(String.valueOf(data.getLiveInfo().getUid()))){
|
||||||
mLivePlayViewHolder.setDrMicInfo(drPkbean);
|
drPkbean.setId(String.valueOf(da.getIntValue("id")));
|
||||||
|
mLivePlayViewHolder.setDrMicInfo(drPkbean);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{//单人连麦
|
}else{//单人连麦
|
||||||
mLivePlayViewHolder.setPkView(data.getEnterRoomInfo().getPkinfo().getPkuid());
|
LivePkMicModel connection_info = data.getEnterRoomInfo().getConnectionInfo();
|
||||||
|
if(!StringUtil.isEmpty(connection_info.getPkuid())){
|
||||||
|
mLivePlayViewHolder.setPkView(connection_info.getPkuid());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mLiveRoomViewHolder != null) {
|
if (mLiveRoomViewHolder != null) {
|
||||||
@ -709,8 +715,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
for (int j = 0; j < array.size(); j++) {
|
for (int j = 0; j < array.size(); j++) {
|
||||||
UserBean drPkbean = new UserBean();
|
UserBean drPkbean = new UserBean();
|
||||||
JSONObject da = array.getJSONObject(j);
|
JSONObject da = array.getJSONObject(j);
|
||||||
drPkbean.setId(String.valueOf(da.getIntValue("id")));
|
if(!String.valueOf(da.getIntValue("id")).equals(data.getLiveInfo().getUid())){
|
||||||
mLivePlayViewHolder.setDrMicInfo(drPkbean);
|
drPkbean.setId(String.valueOf(da.getIntValue("id")));
|
||||||
|
mLivePlayViewHolder.setDrMicInfo(drPkbean);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -768,10 +776,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
|||||||
mLiveRoomViewHolder.showPrizePoolLevel(String.valueOf(giftPrizePoolLevel));
|
mLiveRoomViewHolder.showPrizePoolLevel(String.valueOf(giftPrizePoolLevel));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//liveHandler.postDelayed(loadTimeoutRunnableGone, 15_000);
|
||||||
AppManager.runDebugCode(() -> {
|
AppManager.runDebugCode(() -> {
|
||||||
// liveHandler.postDelayed(loadTimeoutRunnableGone, 1_000);
|
liveHandler.postDelayed(loadTimeoutRunnableGone, 1_000);
|
||||||
});
|
});
|
||||||
liveHandler.postDelayed(loadTimeoutRunnableGone, 15_000);
|
|
||||||
if (TextUtils.equals(data.getEnterRoomInfo().getIsconnection(), "1")) {
|
if (TextUtils.equals(data.getEnterRoomInfo().getIsconnection(), "1")) {
|
||||||
//通知心愿单位置换地方
|
//通知心愿单位置换地方
|
||||||
EventBus.getDefault().post(new LiveAudienceEvent()
|
EventBus.getDefault().post(new LiveAudienceEvent()
|
||||||
|
@ -72,7 +72,7 @@
|
|||||||
android:layout_height="270dp"
|
android:layout_height="270dp"
|
||||||
android:layout_marginTop="130dp"
|
android:layout_marginTop="130dp"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:visibility="visible">
|
android:visibility="gone">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
Loading…
Reference in New Issue
Block a user