add[声望升级-小游戏多人连麦]
This commit is contained in:
@@ -279,7 +279,7 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
public void onSuccess(CreateSudRoomModel data) {
|
||||
if (isHome) {
|
||||
dialog.dismiss();
|
||||
RouteUtil.forwardSudGameActivity(new Gson().toJson(data));
|
||||
RouteUtil.forwardSudGameActivity(new Gson().toJson(data),true,isHome);
|
||||
} else {
|
||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(data));
|
||||
|
||||
|
||||
@@ -43,6 +43,9 @@ public class GameMicManager {
|
||||
private RCRTCRoom mRtcRoom = null;
|
||||
private String mRoomID = "";
|
||||
|
||||
public void setmRoomID(String mRoomID) {
|
||||
this.mRoomID = mRoomID;
|
||||
}
|
||||
|
||||
private final IRCRTCRoomEventsListener roomEventsListener = new IRCRTCRoomEventsListener() {
|
||||
/**
|
||||
@@ -183,43 +186,44 @@ public class GameMicManager {
|
||||
public void refreshStreams(List<SudGameUserModel> personList) {
|
||||
|
||||
final List<RCRTCInputStream> inputStreams = new ArrayList<>();
|
||||
if(mRtcRoom!=null){
|
||||
for (SudGameUserModel sudGameUserModel : personList) {
|
||||
List<RCRTCRemoteUser> rcrtcRemoteUsers = mRtcRoom.getRemoteUsers();
|
||||
|
||||
for (SudGameUserModel sudGameUserModel : personList) {
|
||||
List<RCRTCRemoteUser> rcrtcRemoteUsers = mRtcRoom.getRemoteUsers();
|
||||
|
||||
for (RCRTCRemoteUser rcrtcRemoteUser : rcrtcRemoteUsers) {
|
||||
if (TextUtils.equals(rcrtcRemoteUser.getUserId(), String.valueOf(sudGameUserModel.getId()))) {
|
||||
for (RCRTCInputStream rcrtcInputStream : rcrtcRemoteUser.getStreams()) {
|
||||
rcrtcInputStream.mute(sudGameUserModel.getMicStatus() == 3);
|
||||
for (RCRTCRemoteUser rcrtcRemoteUser : rcrtcRemoteUsers) {
|
||||
if (TextUtils.equals(rcrtcRemoteUser.getUserId(), String.valueOf(sudGameUserModel.getId()))) {
|
||||
for (RCRTCInputStream rcrtcInputStream : rcrtcRemoteUser.getStreams()) {
|
||||
rcrtcInputStream.mute(sudGameUserModel.getMicStatus() == 3);
|
||||
}
|
||||
inputStreams.addAll(rcrtcRemoteUser.getStreams());
|
||||
}
|
||||
inputStreams.addAll(rcrtcRemoteUser.getStreams());
|
||||
}
|
||||
}
|
||||
if (inputStreams.size() == 0) {
|
||||
return;
|
||||
}
|
||||
mRtcRoom.getLocalUser().subscribeStreams(inputStreams, new IRCRTCResultCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
|
||||
|
||||
try {
|
||||
getView().onSubscribeSuccess(inputStreams);
|
||||
} catch (IllegalStateException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(RTCErrorCode errorCode) {
|
||||
try {
|
||||
getView().onSubscribeFailed();
|
||||
} catch (IllegalStateException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if (inputStreams.size() == 0) {
|
||||
return;
|
||||
}
|
||||
mRtcRoom.getLocalUser().subscribeStreams(inputStreams, new IRCRTCResultCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
|
||||
|
||||
try {
|
||||
getView().onSubscribeSuccess(inputStreams);
|
||||
} catch (IllegalStateException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(RTCErrorCode errorCode) {
|
||||
try {
|
||||
getView().onSubscribeFailed();
|
||||
} catch (IllegalStateException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void refreshStreams(String userID, boolean mute, int position) {
|
||||
@@ -242,8 +246,6 @@ public class GameMicManager {
|
||||
mRtcRoom.getLocalUser().subscribeStreams(inputStreams, new IRCRTCResultCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
|
||||
|
||||
try {
|
||||
getView().onSubscribeSuccess(userID, mute, position);
|
||||
} catch (IllegalStateException e) {
|
||||
|
||||
@@ -49,6 +49,7 @@ public class RouteUtil {
|
||||
public static final String PATH_SELECT_AVATAR="/main/UserAvatarSelectActivity";
|
||||
public static final String PATH_BattlePassActivity="/main/BattlePassActivity";
|
||||
public static final String PATH_SudGameActivity="/live/SudGameActivity";
|
||||
|
||||
public static final String PATH_COMMUNITY_Activity="/main/MainHomeCommunityActivity";
|
||||
|
||||
|
||||
@@ -61,9 +62,11 @@ public class RouteUtil {
|
||||
.withString(Constants.TO_UID, uid)
|
||||
.navigation();
|
||||
}
|
||||
public static void forwardSudGameActivity(String CreateSudRoom) {
|
||||
public static void forwardSudGameActivity(String CreateSudRoom,boolean isAn,boolean isHome) {
|
||||
ARouter.getInstance().build(PATH_SudGameActivity)
|
||||
.withString("CreateSudRoom", CreateSudRoom)
|
||||
.withBoolean("CreateIsAn", isAn)
|
||||
.withBoolean("CreateIsHome", isHome)
|
||||
.navigation();
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
|
||||
createSudRoomModel.setSudGameName(model.getSudGameName());
|
||||
if (isHome) {
|
||||
if (TextUtils.equals(model.getLiveUid(), "0")) {
|
||||
RouteUtil.forwardSudGameActivity(new Gson().toJson(createSudRoomModel));
|
||||
RouteUtil.forwardSudGameActivity(new Gson().toJson(createSudRoomModel),false,isHome);
|
||||
|
||||
} else {
|
||||
String yes = "是";
|
||||
@@ -156,7 +156,7 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
|
||||
@Override
|
||||
public void onCancel() {
|
||||
|
||||
RouteUtil.forwardSudGameActivity(new Gson().toJson(createSudRoomModel));
|
||||
RouteUtil.forwardSudGameActivity(new Gson().toJson(createSudRoomModel),false,isHome);
|
||||
}
|
||||
})).show();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user