Commit aebc6e3b by pierce

修复连麦不稳定容易自动被下的问题

parent 69a06fa0
...@@ -910,7 +910,9 @@ ...@@ -910,7 +910,9 @@
return; return;
} }
[FUSLinkMicroHttpHelper fus_replyLinkedMicroWithChannelId:self.channelId roomId:self.roomId status:buttonIndex success:nil failure:^(NSString * _Nonnull msg, int code) { [FUSLinkMicroHttpHelper fus_replyLinkedMicroWithChannelId:self.channelId roomId:self.roomId status:buttonIndex success:^{
[self fus_anchorAllowLinkMicOrYouAcceptLinkMic];
} failure:^(NSString * _Nonnull msg, int code) {
[FUSDialogView fus_showDialog:msg]; [FUSDialogView fus_showDialog:msg];
}]; }];
}]; }];
...@@ -1049,7 +1051,7 @@ ...@@ -1049,7 +1051,7 @@
[FUSDialogView fus_showDialog:[NSString fus_localString:@"连麦成功"]]; [FUSDialogView fus_showDialog:[NSString fus_localString:@"连麦成功"]];
[self.linkMicAgoraHelper fus_openMicro]; [self.linkMicAgoraHelper fus_openMicro];
} }
[self fus_anchorAllowLinkMicOrYouAcceptLinkMic];
}else{ }else{
[FUSDialogView fus_showDialog:[NSString fus_localString:@"主播拒绝了上麦申请,请稍后再试"]]; [FUSDialogView fus_showDialog:[NSString fus_localString:@"主播拒绝了上麦申请,请稍后再试"]];
[self.linkMicAgoraHelper fus_closeMicro]; [self.linkMicAgoraHelper fus_closeMicro];
...@@ -1176,24 +1178,6 @@ ...@@ -1176,24 +1178,6 @@
} failure:nil]; } failure:nil];
} }
[FUSLinkMicroHttpHelper fus_startReportLinkedMicroWithChannelId:self.channelId roomId:self.roomId status:@"1" success:^{
if (FUSConfig.sharedInstanced.devConfigs.enableTestCode) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[FUSDialogView fus_showDialog:@"测试:上报同意连麦,连麦成功!"];
});
}else{
[FUSDialogView fus_showDialog:[NSString fus_localString:@"连麦成功"]];
}
if (!weakSelf.selfCloseMic) {
// 这里如果不先关掉再打开,他声网就会有问题,你说他辣鸡不辣鸡
[weakSelf.linkMicAgoraHelper switchLocalMic:NO];
[weakSelf.linkMicAgoraHelper switchLocalMic:YES];
}
} failure:^(NSString * _Nonnull msg, int code) {
[FUSDialogView fus_showDialog:msg];
}];
}else{ }else{
// 后台说:没有移除中的状态,主播点了移除不管对方是否有真正退出频道成功,都算已经移除 // 后台说:没有移除中的状态,主播点了移除不管对方是否有真正退出频道成功,都算已经移除
// [FUSLinkMicroHttpHelper fus_stopLinkedMicroWithChannelId:self.channelId roomId:self.roomId type:@"1" success:^{ // [FUSLinkMicroHttpHelper fus_stopLinkedMicroWithChannelId:self.channelId roomId:self.roomId type:@"1" success:^{
...@@ -1207,6 +1191,31 @@ ...@@ -1207,6 +1191,31 @@
[self fus_updateHeaderViewSizeWithModels:_models remove:YES]; [self fus_updateHeaderViewSizeWithModels:_models remove:YES];
} }
/// 主播同意了你的连麦申请
/// 或者
/// 你接受了主播的连麦申请
- (void)fus_anchorAllowLinkMicOrYouAcceptLinkMic {
__weak typeof(self) weakSelf = self;
[FUSLinkMicroHttpHelper fus_startReportLinkedMicroWithChannelId:self.channelId roomId:self.roomId status:@"1" success:^{
if (FUSConfig.sharedInstanced.devConfigs.enableTestCode) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[FUSDialogView fus_showDialog:@"测试:上报同意连麦,连麦成功!"];
});
}else{
[FUSDialogView fus_showDialog:[NSString fus_localString:@"连麦成功"]];
}
if (!weakSelf.selfCloseMic) {
// 这里如果不先关掉再打开,他声网就会有问题,你说他辣鸡不辣鸡
[weakSelf.linkMicAgoraHelper switchLocalMic:NO];
[weakSelf.linkMicAgoraHelper switchLocalMic:YES];
}
} failure:^(NSString * _Nonnull msg, int code) {
[FUSDialogView fus_showDialog:msg];
}];
}
/// 麦位变化 /// 麦位变化
- (void)receiveUserLinkMicChangeResult:(NSNotification *)noti{ - (void)receiveUserLinkMicChangeResult:(NSNotification *)noti{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment