From b10c35556d6c9039ea98308688ce586f088303e0 Mon Sep 17 00:00:00 2001 From: liyuhua <15626451870@163.com> Date: Tue, 14 May 2024 18:25:14 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9F=B3=E8=90=8C=E4=BC=81=E4=B8=9A=E5=8C=852.?= =?UTF-8?q?1.5=E5=8F=91=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xplan-ios/Main/RTC/RtcManager.h | 5 ++- .../MenuContainerView/XPRoomSendTextView.m | 9 ++++- xplan-ios/Main/Room/View/RoomHostDelegate.h | 1 + .../Main/Room/View/StageView/StageView.m | 39 +++++++++++++++++-- .../Main/Room/View/XPRoomViewController.m | 4 +- 5 files changed, 51 insertions(+), 7 deletions(-) diff --git a/xplan-ios/Main/RTC/RtcManager.h b/xplan-ios/Main/RTC/RtcManager.h index 19507333..ee7de3eb 100644 --- a/xplan-ios/Main/RTC/RtcManager.h +++ b/xplan-ios/Main/RTC/RtcManager.h @@ -35,7 +35,10 @@ typedef NS_ENUM(NSInteger, BackMusicPlayState) { - ❌ 业务逻辑不要侵入 RctImpl 。 */ @interface RtcManager : NSObject - +///因为跨房pk结束后会闭麦,用这个限制不要关麦 +@property(nonatomic,assign) BOOL isAnckorPk; +///因为最小化进房闭麦问题,用这个限制不要关麦 +@property(nonatomic,assign) BOOL isMiniEnterk; /** * 是否静音(静别人) * YES:🔇虽然你们麦位上在说话,但是我就是不听。🙉 diff --git a/xplan-ios/Main/Room/View/MenuContainerView/XPRoomSendTextView.m b/xplan-ios/Main/Room/View/MenuContainerView/XPRoomSendTextView.m index d8f1ae85..ab1e38e1 100644 --- a/xplan-ios/Main/Room/View/MenuContainerView/XPRoomSendTextView.m +++ b/xplan-ios/Main/Room/View/MenuContainerView/XPRoomSendTextView.m @@ -25,7 +25,7 @@ //公屏限制最大字数 #define MAX_STARWORDS_LENGTH 300 -@interface XPRoomSendTextView () +@interface XPRoomSendTextView () /// @property (nonatomic,strong) UIStackView *stackView; ///输入框 @@ -195,7 +195,10 @@ self.sendButton.enabled = NO; } } - +- (BOOL)textFieldShouldReturn:(UITextField *)textField{ + [self.editTextFiled resignFirstResponder]; + return YES; +} #pragma mark - Public Method + (instancetype)showTextView:(UIView *)view delegate:(id)delegate atUid:(NSString *)uid atNick:(NSString *)nick { __block XPRoomSendTextView * textView; @@ -263,8 +266,10 @@ NSAttributedString * attribute = [[NSAttributedString alloc] initWithString:@"请输入消息..." attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:15], NSForegroundColorAttributeName : [ThemeColor secondTextColor]}]; _editTextFiled.attributedPlaceholder = attribute; _editTextFiled.borderStyle = UITextBorderStyleNone; + _editTextFiled.returnKeyType = UIReturnKeyDone; _editTextFiled.textColor = [ThemeColor alertTitleColor]; _editTextFiled.font = [UIFont systemFontOfSize:15]; + _editTextFiled.delegate = self; [_editTextFiled setContentHuggingPriority:UILayoutPriorityDefaultLow forAxis:UILayoutConstraintAxisHorizontal]; } diff --git a/xplan-ios/Main/Room/View/RoomHostDelegate.h b/xplan-ios/Main/Room/View/RoomHostDelegate.h index 961c82ee..672a6d71 100644 --- a/xplan-ios/Main/Room/View/RoomHostDelegate.h +++ b/xplan-ios/Main/Room/View/RoomHostDelegate.h @@ -36,6 +36,7 @@ NS_ASSUME_NONNULL_BEGIN - (NSArray *)getRoomPKGroupTeamList; ///房间内PK是否正在进行 - (BOOL)isRoomPKPlaying; +-(BOOL)getIsMiniEnter; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/StageView/StageView.m b/xplan-ios/Main/Room/View/StageView/StageView.m index e51ead0c..b821d6af 100644 --- a/xplan-ios/Main/Room/View/StageView/StageView.m +++ b/xplan-ios/Main/Room/View/StageView/StageView.m @@ -74,6 +74,16 @@ if (self) { _hostDelegate = delegate; _isMiniEnter = NO; + [RtcManager instance].isMiniEnterk = self.hostDelegate.getIsMiniEnter; + RoomInfoModel *roomInfo = self.hostDelegate.getRoomInfo; + if (roomInfo.roomModeType != RoomModeType_Open_AcrossRoomPK_mode ){ + if ([RtcManager instance].isAnckorPk == NO){ + if ([RtcManager instance].isMiniEnterk == NO){ + [RtcManager instance].localMuted = YES; + } + + } + } NSInteger microCount = self.countOfMircoView; for (int i = 0; i < microCount; i++) { UIView* microView = [self microViewForIndex:i]; @@ -590,8 +600,19 @@ sequence.userInfo = nil; } } - - if (changeType == 1) { // 上麦 + RoomInfoModel *roomInfo = self.hostDelegate.getRoomInfo; + if (changeType == 2){ + if (userInfo.uid == [AccountInfoStorage instance].getUid.integerValue && roomInfo.roomModeType == RoomModeType_Open_Blind){ + 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]; sequence.userInfo = userInfo; if (self.hostDelegate.getRoomInfo.showGiftValue && userInfo.uid == [AccountInfoStorage instance].getUid.integerValue) { @@ -617,7 +638,19 @@ } //如果是当前用户上麦,关闭自己的麦克风 if (sequence && sequence.userInfo.uid == [AccountInfoStorage instance].getUid.integerValue && userInfo.isNoProhibitMic == NO) { - [RtcManager instance].localMuted = YES; + if (roomInfo.roomModeType != RoomModeType_Open_Blind){ + if (userInfo.isNoProhibitMic == NO){ + if (roomInfo.roomModeType != RoomModeType_Open_AcrossRoomPK_mode){ + if ([RtcManager instance].isMiniEnterk == NO){ + [RtcManager instance].localMuted = YES; + } + + } + } + } + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [RtcManager instance].isMiniEnterk = NO; + }); } } if(userInfo.isNoProhibitMic == YES){ diff --git a/xplan-ios/Main/Room/View/XPRoomViewController.m b/xplan-ios/Main/Room/View/XPRoomViewController.m index 7be3eeff..24037e6e 100644 --- a/xplan-ios/Main/Room/View/XPRoomViewController.m +++ b/xplan-ios/Main/Room/View/XPRoomViewController.m @@ -1652,7 +1652,9 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 self.anchorScrollView.contentOffset = CGPointMake(0, KScreenHeight); } } - +-(BOOL)getIsMiniEnter{ + return self.isMiniEnter; +} #pragma mark - XPRoomSettingInputViewDelegate ///点击了完成 - (void)xPRoomSettingInputView:(XPRoomSettingInputView *)view didClickConfirm:(NSString *)text type:(RoomSettingInputType)type {