修复bug

This commit is contained in:
liyuhua
2024-03-12 20:58:33 +08:00
parent 905e3ed441
commit 4dd0447c6f
6 changed files with 64 additions and 11 deletions

View File

@@ -35,7 +35,8 @@ typedef NS_ENUM(NSInteger, BackMusicPlayState) {
- ❌ 业务逻辑不要侵入 RctImpl 。
*/
@interface RtcManager : NSObject
///因为跨房pk结束后会闭麦用这个限制不要关麦
@property(nonatomic,assign) BOOL isAnckorPk;
/**
* 是否静音(静别人)
* YES🔇虽然你们麦位上在说话但是我就是不听。🙉

View File

@@ -18,10 +18,10 @@
@"csRank" : [AcrossRoomPkRankModel class]
};
}
/// id -> ID name -> other.name
+ (NSDictionary *)replacedKeyFromPropertyName {
return @{@"aMicStatus":@"amicStatus"};
}
///// id -> ID name -> other.name
//+ (NSDictionary *)replacedKeyFromPropertyName {
// return @{@"aMicStatus":@"amicStatus"};
//}
@end

View File

@@ -527,8 +527,12 @@
} else {
self.otherMicButton.hidden = ![pkPanelInfo.cUid isEqualToString:[AccountInfoStorage instance].getUid];
}
self.otherMicButton.selected = pkPanelInfo.aMicStatus == AnchorPKOtherMicStatus_Close;
[[RtcManager instance] muteOne:pkPanelInfo.aMicStatus == AnchorPKOtherMicStatus_Close userId:pkPanelInfo.aUid];
[RtcManager instance].isAnckorPk = YES;
self.otherMicButton.selected = pkPanelInfo.aMicStatus == AnchorPKOtherMicStatus_Close;
[[RtcManager instance] muteOne:pkPanelInfo.aMicStatus == AnchorPKOtherMicStatus_Close userId:pkPanelInfo.aUid];
} else {
self.redCountLabel.text = @"0";
self.blueCountLabel.text = @"0";

View File

@@ -609,6 +609,10 @@
[Api getAcrossRoomPKDetail:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:data.data];
if (data.data[@"amicStatus"] != nil){
acrossPKPanelInfo.aMicStatus = [data.data[@"amicStatus"] intValue];
}
[self updateAnchorPkInfo:acrossPKPanelInfo];
if (acrossPKPanelInfo.pkType == AcrossRoomPkTypeAnchor) {
if (acrossPKPanelInfo.aUid.integerValue > 0) {
@@ -623,6 +627,9 @@
}
} else {
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:data.data];
if (data.data[@"amicStatus"] != nil){
acrossPKPanelInfo.aMicStatus = [data.data[@"amicStatus"] intValue];
}
if (acrossPKPanelInfo.aUid.integerValue > 0) {
if (!self.acrossPKPanelView.superview) {
[self addSubview:self.acrossPKPanelView];
@@ -786,6 +793,9 @@
}];
}
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:attachment.data];
if (attachment.data[@"amicStatus"] != nil){
acrossPKPanelInfo.aMicStatus = [attachment.data[@"amicStatus"] intValue];
}
self.acrossPKPanelView.pkPanelInfo = acrossPKPanelInfo;
}
break;
@@ -796,6 +806,9 @@
[self.acrossPKPanelView resetAcrossPKViewData];
[self.acrossPKPanelView removeFromSuperview];
AcrossRoomPKPanelModel * model = [AcrossRoomPKPanelModel modelWithJSON:attachment.data];
if (attachment.data[@"amicStatus"] != nil){
model.aMicStatus = [attachment.data[@"amicStatus"] intValue];
}
if (model.isForce) {
XPAcrossRoomPKForceEndResultView *view = [[XPAcrossRoomPKForceEndResultView alloc] initWithFrame:CGRectMake(0, 0, 281, 208)];
view.data = model;
@@ -837,6 +850,9 @@
NIMChatroomMember * member = [members firstObject];
if (member.type == NIMTeamMemberTypeOwner) {
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:attachment.data];
if (attachment.data[@"amicStatus"] != nil){
acrossPKPanelInfo.aMicStatus = [attachment.data[@"amicStatus"] intValue];
}
[[RtcManager instance] connectOtherRoom:acrossPKPanelInfo.aRoomId userId:acrossPKPanelInfo.aUid];
[self updateAnchorPkInfo:acrossPKPanelInfo];
}
@@ -881,6 +897,9 @@
}];
}
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:attachment.data];
if (attachment.data[@"amicStatus"] != nil){
acrossPKPanelInfo.aMicStatus = [attachment.data[@"amicStatus"] intValue];
}
self.anchorPKPanelView.pkPanelInfo = acrossPKPanelInfo;
[self updateAnchorPkInfo:acrossPKPanelInfo];
}
@@ -895,6 +914,9 @@
}];
}
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:attachment.data];
if (attachment.data[@"amicStatus"] != nil){
acrossPKPanelInfo.aMicStatus = [attachment.data[@"amicStatus"] intValue];
}
self.anchorPKPanelView.pkPanelInfo = acrossPKPanelInfo;
[self updateAnchorPkInfo:acrossPKPanelInfo];
if (acrossPKPanelInfo.isForce) {

View File

@@ -170,6 +170,9 @@
[Api getAcrossRoomPKDetail:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:data.data];
if (data.data[@"amicStatus"] != nil){
acrossPKPanelInfo.aMicStatus = [data.data[@"amicStatus"] intValue];
}
if (acrossPKPanelInfo.pkType == AcrossRoomPkTypeAnchor) {
self.hostDelegate.getRoomInfo.roundId = acrossPKPanelInfo.roundId;
self.hostDelegate.getRoomInfo.pkUid = acrossPKPanelInfo.aUid;

View File

@@ -76,7 +76,15 @@
if (self) {
_hostDelegate = delegate;
_isMiniEnter = NO;
[RtcManager instance].localMuted = YES;
RoomInfoModel *roomInfo = self.hostDelegate.getRoomInfo;
if (roomInfo.roomModeType != RoomModeType_Open_AcrossRoomPK_mode ){
NSLog(@"%d",[RtcManager instance].isAnckorPk);
if ([RtcManager instance].isAnckorPk == NO){
[RtcManager instance].localMuted = YES;
}
}
NSInteger microCount = self.countOfMircoView;
for (int i = 0; i < microCount; i++) {
UIView* microView = [self microViewForIndex:i];
@@ -278,7 +286,11 @@
if (self.hostDelegate.getUserInfo.uid && model.userInfo.uid == self.hostDelegate.getUserInfo.uid) {
selfNeedBroadcast = model.microState.micState == MicroMicStateType_Open;
if (model.microState.micState == MicroMicStateType_Close) {
[RtcManager instance].localMuted = YES;
if (roomInfo.roomModeType != RoomModeType_Open_AcrossRoomPK_mode){
[RtcManager instance].localMuted = YES;
}
}
if (roomInfo.type == RoomType_Anchor && [[AccountInfoStorage instance].getUid isEqualToString:[NSString stringWithFormat:@"%ld", roomInfo.uid]]) {
selfNeedBroadcast = YES;///
@@ -497,7 +509,16 @@
RoomInfoModel *roomInfo = self.hostDelegate.getRoomInfo;
if (changeType == 2){
if (userInfo.uid == [AccountInfoStorage instance].getUid.integerValue && roomInfo.roomModeType == RoomModeType_Open_Blind){
[RtcManager instance].localMuted = YES;
if (roomInfo.roomModeType != RoomModeType_Open_AcrossRoomPK_mode ){
if ([RtcManager instance].isAnckorPk == NO){
[RtcManager instance].localMuted = YES;
}
[RtcManager instance].isAnckorPk = NO;
}
}
}else if (changeType == 1) { //
MicroQueueModel *sequence = [self.micQueue objectForKey:position];
@@ -531,7 +552,9 @@
if (sequence && sequence.userInfo.uid == [AccountInfoStorage instance].getUid.integerValue) {
if (roomInfo.roomModeType != RoomModeType_Open_Blind){
if (userInfo.isNoProhibitMic == NO){
[RtcManager instance].localMuted = YES;
if (roomInfo.roomModeType != RoomModeType_Open_AcrossRoomPK_mode){
[RtcManager instance].localMuted = YES;
}
}
}
}