Commit 35908849 by ludi

解决上下麦流的问题

parent 65cc6848
......@@ -510,8 +510,11 @@
self.mute = muted;
});
} else {
[self fus_setupLiveSessionConfigs];
[self fus_startStreamPushWithUrl:self.pushUrl pushMixUrl:self.pushMixUrl completionHandler:self.completionHandler];
MJWeakSelf
dispatch_async_on_main_queue(^{
[weakSelf fus_setupLiveSessionConfigs];
[weakSelf fus_startStreamPushWithUrl:self.pushUrl pushMixUrl:self.pushMixUrl completionHandler:self.completionHandler];
});
}
}
......
......@@ -673,7 +673,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 202506260037;
CURRENT_PROJECT_VERSION = 202506260038;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 6GG26BHUMC;
ENABLE_ON_DEMAND_RESOURCES = NO;
......@@ -938,7 +938,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 202506260037;
CURRENT_PROJECT_VERSION = 202506260038;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 6GG26BHUMC;
ENABLE_ON_DEMAND_RESOURCES = NO;
......
......@@ -833,7 +833,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
- (void)initPlayView {
[self installObservers];
if (_playView) {
if (self.playView) {
[self.contentView bringSubviewToFront:_liveFunctionView];
return;
}
......@@ -847,7 +847,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
[self.contentView bringSubviewToFront:_liveFunctionView];
//回调当前码率
[_playView setPlayBitrateUpdateHandler:^(double bitrate) {
[self.playView setPlayBitrateUpdateHandler:^(double bitrate) {
[weakSelf.liveFunctionView fus_updataBitrateWithRate:bitrate];
}];
......@@ -1253,9 +1253,9 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
// [_streamView fus_reloadWatermark];
_playView.mainUID = [FUSLiveHelper shareInstance].roomInfoModel.roomId;
self.playView.mainUID = [FUSLiveHelper shareInstance].roomInfoModel.roomId;
[_playView fus_setVideoframeCallBackOpen:self.autoStartPictureInPicture forUid:self.playView.mainUID];
[self.playView fus_setVideoframeCallBackOpen:self.autoStartPictureInPicture forUid:self.playView.mainUID];
self.scrollEnableCount = 0;
if (self.autoStartPictureInPicture) {
[self setupPictureInPicture];
......@@ -1269,8 +1269,8 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
// 更新状态
_streamState = FUSStreamStateIdle;
_playView.hidden = YES;
[_playView fus_destroyAllPlayer];
self.playView.hidden = YES;
[self.playView fus_destroyAllPlayer];
}
/**
......@@ -1477,7 +1477,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
if ([[FUSLiveHelper shareInstance] liveType] == FUSLiveTypeAudience) {
// [_playView fus_reloadPlayer];
[_playView fus_reloadPlayerWithUID:[FUSLiveHelper shareInstance].roomInfoModel.roomId];
[self.playView fus_reloadPlayerWithUID:[FUSLiveHelper shareInstance].roomInfoModel.roomId];
[_liveFunctionView fus_addPusherTipMessage:[NSString fus_localString:@"您当前正在使用3G/4G网络"] title:[NSString fus_localString:@"主播温馨提醒"]];
} else if ([[FUSLiveHelper shareInstance] liveType] == FUSLiveTypeAnchor) {
......@@ -1601,7 +1601,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
if ([[FUSLiveHelper shareInstance] liveType] == FUSLiveTypeAudience) {
// 播放
[_streamView.playView fus_stopALLPlayer];
[_playView fus_stopALLPlayer];
[self.playView fus_stopALLPlayer];
// 播放
[self.playView fus_stopWithUID:[FUSLiveHelper shareInstance].roomInfoModel.roomId];
......@@ -1755,7 +1755,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
// [_pushView fus_restartPush];
} else if ([[FUSLiveHelper shareInstance] liveType] == FUSLiveTypeAudience) {
// [_playView fus_reloadPlayer];
[_playView fus_reloadPlayerWithUID:[FUSLiveHelper shareInstance].roomInfoModel.roomId];
[self.playView fus_reloadPlayerWithUID:[FUSLiveHelper shareInstance].roomInfoModel.roomId];
}
}
......@@ -2039,7 +2039,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
// 播放端结束画面
[_streamView.playView fus_destroyAllPlayer];
[_playView fus_destroyAllPlayer];
[self.playView fus_destroyAllPlayer];
FUSSwiftLiveHelper.shared.hasEnded = YES;
if (![NSDictionary isNull:infoDict]) {
......@@ -2543,9 +2543,9 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
_scrollView.offsetY = UIView.fus_screenH;
// 停止播放
[self fus_stopPlay];
[self fus_updatePlayingView:NO];
FUSRoomInfoModel *model = [FUSSwiftLiveHelper preRoomInfoModel];
[FUSSwiftLiveHelper.shared switchRoomWithRoomInfoModel:model hasPreloadVideo:YES success:nil failure:nil];
[self fus_updatePlayingView:NO];
// 重置数据
[self fus_resetData];
self.scrollEnableCount += 1;
......@@ -2565,9 +2565,9 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
_scrollView.offsetY = UIView.fus_screenH;
// 停止播放
[self fus_stopPlay];
[self fus_updatePlayingView:YES];
FUSRoomInfoModel *model = [FUSSwiftLiveHelper nextRoomInfoModel];
[FUSSwiftLiveHelper.shared switchRoomWithRoomInfoModel:model hasPreloadVideo:YES success:nil failure:nil];
[self fus_updatePlayingView:YES];
// 重置数据
[self fus_resetData];
self.scrollEnableCount += 1;
......@@ -2795,7 +2795,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
}
}
_autoStartPictureInPicture = autoStartPictureInPicture;
[_playView fus_setVideoframeCallBackOpen:autoStartPictureInPicture forUid:self.playView.mainUID];
[self.playView fus_setVideoframeCallBackOpen:autoStartPictureInPicture forUid:self.playView.mainUID];
}
}
......
......@@ -442,7 +442,7 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
strongSelf.captureHelper.onlyCapture = NO;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[strongSelf.captureHelper fus_resumeAudioCapture];
[strongSelf.captureHelper fus_resumeCapture];
[strongSelf.captureHelper fus_restartStreamPush];
strongSelf.captureHelper.mute = !strongSelf.localMicEnable; //索隆:声音问题最难搞~~,这里使用ttsdk开播的时候记得要重新设置
});
......@@ -782,7 +782,8 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
- (BOOL)onRenderVideoFrame:(AgoraOutputVideoFrame *)videoFrame uid:(NSUInteger)uid channelId:(NSString *)channelId {
if (uid == [FUSLiveHelper shareInstance].roomInfoModel.roomId.integerValue &&
[FUSLiveHelper shareInstance].liveType == FUSLiveTypeAudience) {
FUSStreamPlayView *playView = [FUSLiveHelper shareInstance].streamView.playView;
// FUSStreamPlayView *playView = [FUSLiveHelper shareInstance].streamView.playView;
FUSStreamPlayView *playView = [(FUSLiveMainViewController *)[FUSLiveHelper shareInstance].fus_getTargetViewController fus_playViewForMainUid:[FUSLiveHelper shareInstance].roomInfoModel.roomId];
if (playView.playerVideoFrameCallBackHandler) {
playView.playerVideoFrameCallBackHandler([NSString stringWithFormat:@"%zd",uid], videoFrame.pixelBuffer);
}
......@@ -823,7 +824,8 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
if (uid == [FUSLiveHelper shareInstance].roomInfoModel.roomId.integerValue &&
[FUSLiveHelper shareInstance].liveType == FUSLiveTypeAudience) {
FUSStreamPlayView *playView = [FUSLiveHelper shareInstance].streamView.playView;
// FUSStreamPlayView *playView = [FUSLiveHelper shareInstance].streamView.playView;
FUSStreamPlayView *playView = [(FUSLiveMainViewController *)[FUSLiveHelper shareInstance].fus_getTargetViewController fus_playViewForMainUid:[FUSLiveHelper shareInstance].roomInfoModel.roomId];
AgoraRtcVideoCanvas *otherCanvas = [[AgoraRtcVideoCanvas alloc] init];
otherCanvas.uid = [FUSLiveHelper shareInstance].roomInfoModel.roomId.integerValue;
......@@ -840,7 +842,7 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
}];
}
// playView.agoraOtherPreview = _agoraOtherPreview; // Property might not exist
playView.agoraOtherPreview = _agoraOtherPreview; // Property might not exist
[engine setVideoFrameDelegate:self];
}
......
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