Commit 48539ae9 by ludi

Merge branch 'feature/私讯+座驾体系' of http://git.yabolive.net:88/pidan/FuSiLive into feature/私讯+座驾体系

parents c28584b6 f6352692
...@@ -485,6 +485,15 @@ ...@@ -485,6 +485,15 @@
[self.engine.camera resumeCameraCapture]; [self.engine.camera resumeCameraCapture];
} }
- (void)fus_pauseAudioCapture {
[self.engine stopAudioCapture];
}
- (void)fus_resumeAudioCapture {
[self.engine startAudioCapture];
}
/** /**
获取实时统计信息 获取实时统计信息
......
...@@ -141,6 +141,10 @@ typedef NS_ENUM(NSUInteger, FUSLiveCoreNetworkQuality) { ...@@ -141,6 +141,10 @@ typedef NS_ENUM(NSUInteger, FUSLiveCoreNetworkQuality) {
- (void)fus_resumeCapture; - (void)fus_resumeCapture;
- (void)fus_pauseAudioCapture;
- (void)fus_resumeAudioCapture;
/// 重置推流的帧率 /// 重置推流的帧率
- (void)fus_setFPS:(NSInteger)fps; - (void)fus_setFPS:(NSInteger)fps;
......
...@@ -117,6 +117,14 @@ ...@@ -117,6 +117,14 @@
} }
- (void)fus_pauseAudioCapture {
}
- (void)fus_resumeAudioCapture {
}
/** /**
获取实时统计信息 获取实时统计信息
......
...@@ -577,13 +577,15 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange"; ...@@ -577,13 +577,15 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
- (void)delayUpdateToSpeakerPlay { - (void)delayUpdateToSpeakerPlay {
dispatch_async(dispatch_get_global_queue(0, 0), ^{
AVAudioSessionCategoryOptions currentCategoryOptions = [AVAudioSession sharedInstance].categoryOptions; AVAudioSessionCategoryOptions currentCategoryOptions = [AVAudioSession sharedInstance].categoryOptions;
[self.agoraEngine setEnableSpeakerphone:YES]; [self->_agoraEngine setEnableSpeakerphone:YES];
currentCategoryOptions = [AVAudioSession sharedInstance].categoryOptions; AVAudioSessionCategoryOptions categoryOptions = 43;
AVAudioSessionCategory currentCategory = [AVAudioSession sharedInstance].category;
AVAudioSessionCategoryOptions categoryOptions = AVAudioSessionCategoryOptionMixWithOthers | AVAudioSessionCategoryOptionAllowBluetooth | AVAudioSessionCategoryOptionDefaultToSpeaker | AVAudioSessionCategoryOptionAllowBluetoothA2DP;
NSError *error; NSError *error;
if (currentCategoryOptions < categoryOptions) {
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:categoryOptions error:&error]; [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:categoryOptions error:&error];
}
AVAudioSessionRouteDescription *currentRoute = [AVAudioSession sharedInstance].currentRoute; AVAudioSessionRouteDescription *currentRoute = [AVAudioSession sharedInstance].currentRoute;
BOOL needForceToSpeaker = NO; BOOL needForceToSpeaker = NO;
for (AVAudioSessionPortDescription *port in currentRoute.outputs) { for (AVAudioSessionPortDescription *port in currentRoute.outputs) {
...@@ -598,9 +600,9 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange"; ...@@ -598,9 +600,9 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
} }
[[AVAudioSession sharedInstance] setActive:YES error:nil]; [[AVAudioSession sharedInstance] setActive:YES error:nil];
currentCategoryOptions = [AVAudioSession sharedInstance].categoryOptions; currentCategoryOptions = [AVAudioSession sharedInstance].categoryOptions;
});
} }
#pragma mark - AgoraVideoFrameDelegate #pragma mark - AgoraVideoFrameDelegate
- (BOOL)onRenderVideoFrame:(AgoraOutputVideoFrame *)videoFrame uid:(NSUInteger)uid channelId:(NSString *)channelId { - (BOOL)onRenderVideoFrame:(AgoraOutputVideoFrame *)videoFrame uid:(NSUInteger)uid channelId:(NSString *)channelId {
if (uid == FUSLiveHelper.shareInstance.roomInfoModel.roomId.integerValue && if (uid == FUSLiveHelper.shareInstance.roomInfoModel.roomId.integerValue &&
......
...@@ -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,6 +1178,24 @@ ...@@ -1176,6 +1178,24 @@
} failure:nil]; } failure:nil];
} }
}else{
// 后台说:没有移除中的状态,主播点了移除不管对方是否有真正退出频道成功,都算已经移除
// [FUSLinkMicroHttpHelper fus_stopLinkedMicroWithChannelId:self.channelId roomId:self.roomId type:@"1" success:^{
// [FUSDialogView fus_showDialog:@"上报闭麦成功!"];
// } failure:^(NSString * _Nonnull msg, int code) {
// [FUSDialogView fus_showDialog:msg];
// }];
}
[_models removeObject:_emptyModel];
[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:^{ [FUSLinkMicroHttpHelper fus_startReportLinkedMicroWithChannelId:self.channelId roomId:self.roomId status:@"1" success:^{
if (FUSConfig.sharedInstanced.devConfigs.enableTestCode) { if (FUSConfig.sharedInstanced.devConfigs.enableTestCode) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
...@@ -1194,17 +1214,6 @@ ...@@ -1194,17 +1214,6 @@
} failure:^(NSString * _Nonnull msg, int code) { } failure:^(NSString * _Nonnull msg, int code) {
[FUSDialogView fus_showDialog:msg]; [FUSDialogView fus_showDialog:msg];
}]; }];
}else{
// 后台说:没有移除中的状态,主播点了移除不管对方是否有真正退出频道成功,都算已经移除
// [FUSLinkMicroHttpHelper fus_stopLinkedMicroWithChannelId:self.channelId roomId:self.roomId type:@"1" success:^{
// [FUSDialogView fus_showDialog:@"上报闭麦成功!"];
// } failure:^(NSString * _Nonnull msg, int code) {
// [FUSDialogView fus_showDialog:msg];
// }];
}
[_models removeObject:_emptyModel];
[self fus_updateHeaderViewSizeWithModels:_models remove:YES];
} }
/// 麦位变化 /// 麦位变化
......
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