Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
pidan
/
FuSiLive
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
35908849
authored
Mar 11, 2026
by
ludi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决上下麦流的问题
parent
65cc6848
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
21 deletions
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Views/StreamView/LiveStreamView/Push/Capture/TTSDK/Base/FUSStreamCatureHelper.m
FuSiLive.xcodeproj/project.pbxproj
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/Controller/FUSLiveMainViewController.m
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/LinkMicro/Other/FUSAgoraHelper.m
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Views/StreamView/LiveStreamView/Push/Capture/TTSDK/Base/FUSStreamCatureHelper.m
View file @
35908849
...
@@ -510,8 +510,11 @@
...
@@ -510,8 +510,11 @@
self
.
mute
=
muted
;
self
.
mute
=
muted
;
});
});
}
else
{
}
else
{
[
self
fus_setupLiveSessionConfigs
];
MJWeakSelf
[
self
fus_startStreamPushWithUrl
:
self
.
pushUrl
pushMixUrl
:
self
.
pushMixUrl
completionHandler
:
self
.
completionHandler
];
dispatch_async_on_main_queue
(
^
{
[
weakSelf
fus_setupLiveSessionConfigs
];
[
weakSelf
fus_startStreamPushWithUrl
:
self
.
pushUrl
pushMixUrl
:
self
.
pushMixUrl
completionHandler
:
self
.
completionHandler
];
});
}
}
}
}
...
...
FuSiLive.xcodeproj/project.pbxproj
View file @
35908849
...
@@ -673,7 +673,7 @@
...
@@ -673,7 +673,7 @@
CLANG_CXX_LANGUAGE_STANDARD
=
"gnu++17"
;
CLANG_CXX_LANGUAGE_STANDARD
=
"gnu++17"
;
CODE_SIGN_ENTITLEMENTS
=
FuSiLive/FuSiLive.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
FuSiLive/FuSiLive.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
20250626003
7
;
CURRENT_PROJECT_VERSION
=
20250626003
8
;
DEFINES_MODULE
=
YES
;
DEFINES_MODULE
=
YES
;
DEVELOPMENT_TEAM
=
6GG26BHUMC
;
DEVELOPMENT_TEAM
=
6GG26BHUMC
;
ENABLE_ON_DEMAND_RESOURCES
=
NO
;
ENABLE_ON_DEMAND_RESOURCES
=
NO
;
...
@@ -938,7 +938,7 @@
...
@@ -938,7 +938,7 @@
CLANG_CXX_LANGUAGE_STANDARD
=
"gnu++17"
;
CLANG_CXX_LANGUAGE_STANDARD
=
"gnu++17"
;
CODE_SIGN_ENTITLEMENTS
=
FuSiLive/FuSiLive.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
FuSiLive/FuSiLive.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
20250626003
7
;
CURRENT_PROJECT_VERSION
=
20250626003
8
;
DEFINES_MODULE
=
YES
;
DEFINES_MODULE
=
YES
;
DEVELOPMENT_TEAM
=
6GG26BHUMC
;
DEVELOPMENT_TEAM
=
6GG26BHUMC
;
ENABLE_ON_DEMAND_RESOURCES
=
NO
;
ENABLE_ON_DEMAND_RESOURCES
=
NO
;
...
...
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/Controller/FUSLiveMainViewController.m
View file @
35908849
...
@@ -833,7 +833,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -833,7 +833,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
-
(
void
)
initPlayView
{
-
(
void
)
initPlayView
{
[
self
installObservers
];
[
self
installObservers
];
if
(
_
playView
)
{
if
(
self
.
playView
)
{
[
self
.
contentView
bringSubviewToFront
:
_liveFunctionView
];
[
self
.
contentView
bringSubviewToFront
:
_liveFunctionView
];
return
;
return
;
}
}
...
@@ -847,7 +847,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -847,7 +847,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
[
self
.
contentView
bringSubviewToFront
:
_liveFunctionView
];
[
self
.
contentView
bringSubviewToFront
:
_liveFunctionView
];
//回调当前码率
//回调当前码率
[
_
playView
setPlayBitrateUpdateHandler
:
^
(
double
bitrate
)
{
[
self
.
playView
setPlayBitrateUpdateHandler
:
^
(
double
bitrate
)
{
[
weakSelf
.
liveFunctionView
fus_updataBitrateWithRate
:
bitrate
];
[
weakSelf
.
liveFunctionView
fus_updataBitrateWithRate
:
bitrate
];
}];
}];
...
@@ -1253,9 +1253,9 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -1253,9 +1253,9 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
// [_streamView fus_reloadWatermark];
// [_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
;
self
.
scrollEnableCount
=
0
;
if
(
self
.
autoStartPictureInPicture
)
{
if
(
self
.
autoStartPictureInPicture
)
{
[
self
setupPictureInPicture
];
[
self
setupPictureInPicture
];
...
@@ -1269,8 +1269,8 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -1269,8 +1269,8 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
// 更新状态
// 更新状态
_streamState
=
FUSStreamStateIdle
;
_streamState
=
FUSStreamStateIdle
;
_
playView
.
hidden
=
YES
;
self
.
playView
.
hidden
=
YES
;
[
_
playView
fus_destroyAllPlayer
];
[
self
.
playView
fus_destroyAllPlayer
];
}
}
/**
/**
...
@@ -1477,7 +1477,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -1477,7 +1477,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
if
([[
FUSLiveHelper
shareInstance
]
liveType
]
==
FUSLiveTypeAudience
)
{
if
([[
FUSLiveHelper
shareInstance
]
liveType
]
==
FUSLiveTypeAudience
)
{
// [_playView fus_reloadPlayer];
// [_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
:
@"主播温馨提醒"
]];
[
_liveFunctionView
fus_addPusherTipMessage
:[
NSString
fus_localString
:
@"您当前正在使用3G/4G网络"
]
title
:[
NSString
fus_localString
:
@"主播温馨提醒"
]];
}
else
if
([[
FUSLiveHelper
shareInstance
]
liveType
]
==
FUSLiveTypeAnchor
)
{
}
else
if
([[
FUSLiveHelper
shareInstance
]
liveType
]
==
FUSLiveTypeAnchor
)
{
...
@@ -1601,7 +1601,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -1601,7 +1601,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
if
([[
FUSLiveHelper
shareInstance
]
liveType
]
==
FUSLiveTypeAudience
)
{
if
([[
FUSLiveHelper
shareInstance
]
liveType
]
==
FUSLiveTypeAudience
)
{
// 播放
// 播放
[
_streamView
.
playView
fus_stopALLPlayer
];
[
_streamView
.
playView
fus_stopALLPlayer
];
[
_
playView
fus_stopALLPlayer
];
[
self
.
playView
fus_stopALLPlayer
];
// 播放
// 播放
[
self
.
playView
fus_stopWithUID
:[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
roomId
];
[
self
.
playView
fus_stopWithUID
:[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
roomId
];
...
@@ -1755,7 +1755,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -1755,7 +1755,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
// [_pushView fus_restartPush];
// [_pushView fus_restartPush];
}
else
if
([[
FUSLiveHelper
shareInstance
]
liveType
]
==
FUSLiveTypeAudience
)
{
}
else
if
([[
FUSLiveHelper
shareInstance
]
liveType
]
==
FUSLiveTypeAudience
)
{
// [_playView fus_reloadPlayer];
// [_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) {
...
@@ -2039,7 +2039,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
// 播放端结束画面
// 播放端结束画面
[
_streamView
.
playView
fus_destroyAllPlayer
];
[
_streamView
.
playView
fus_destroyAllPlayer
];
[
_
playView
fus_destroyAllPlayer
];
[
self
.
playView
fus_destroyAllPlayer
];
FUSSwiftLiveHelper
.
shared
.
hasEnded
=
YES
;
FUSSwiftLiveHelper
.
shared
.
hasEnded
=
YES
;
if
(
!
[
NSDictionary
isNull
:
infoDict
])
{
if
(
!
[
NSDictionary
isNull
:
infoDict
])
{
...
@@ -2543,9 +2543,9 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -2543,9 +2543,9 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
_scrollView
.
offsetY
=
UIView
.
fus_screenH
;
_scrollView
.
offsetY
=
UIView
.
fus_screenH
;
// 停止播放
// 停止播放
[
self
fus_stopPlay
];
[
self
fus_stopPlay
];
[
self
fus_updatePlayingView
:
NO
];
FUSRoomInfoModel
*
model
=
[
FUSSwiftLiveHelper
preRoomInfoModel
];
FUSRoomInfoModel
*
model
=
[
FUSSwiftLiveHelper
preRoomInfoModel
];
[
FUSSwiftLiveHelper
.
shared
switchRoomWithRoomInfoModel
:
model
hasPreloadVideo
:
YES
success
:
nil
failure
:
nil
];
[
FUSSwiftLiveHelper
.
shared
switchRoomWithRoomInfoModel
:
model
hasPreloadVideo
:
YES
success
:
nil
failure
:
nil
];
[
self
fus_updatePlayingView
:
NO
];
// 重置数据
// 重置数据
[
self
fus_resetData
];
[
self
fus_resetData
];
self
.
scrollEnableCount
+=
1
;
self
.
scrollEnableCount
+=
1
;
...
@@ -2565,9 +2565,9 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -2565,9 +2565,9 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
_scrollView
.
offsetY
=
UIView
.
fus_screenH
;
_scrollView
.
offsetY
=
UIView
.
fus_screenH
;
// 停止播放
// 停止播放
[
self
fus_stopPlay
];
[
self
fus_stopPlay
];
[
self
fus_updatePlayingView
:
YES
];
FUSRoomInfoModel
*
model
=
[
FUSSwiftLiveHelper
nextRoomInfoModel
];
FUSRoomInfoModel
*
model
=
[
FUSSwiftLiveHelper
nextRoomInfoModel
];
[
FUSSwiftLiveHelper
.
shared
switchRoomWithRoomInfoModel
:
model
hasPreloadVideo
:
YES
success
:
nil
failure
:
nil
];
[
FUSSwiftLiveHelper
.
shared
switchRoomWithRoomInfoModel
:
model
hasPreloadVideo
:
YES
success
:
nil
failure
:
nil
];
[
self
fus_updatePlayingView
:
YES
];
// 重置数据
// 重置数据
[
self
fus_resetData
];
[
self
fus_resetData
];
self
.
scrollEnableCount
+=
1
;
self
.
scrollEnableCount
+=
1
;
...
@@ -2795,7 +2795,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -2795,7 +2795,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
}
}
}
}
_autoStartPictureInPicture
=
autoStartPictureInPicture
;
_autoStartPictureInPicture
=
autoStartPictureInPicture
;
[
_
playView
fus_setVideoframeCallBackOpen
:
autoStartPictureInPicture
forUid
:
self
.
playView
.
mainUID
];
[
self
.
playView
fus_setVideoframeCallBackOpen
:
autoStartPictureInPicture
forUid
:
self
.
playView
.
mainUID
];
}
}
}
}
...
...
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/LinkMicro/Other/FUSAgoraHelper.m
View file @
35908849
...
@@ -442,7 +442,7 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
...
@@ -442,7 +442,7 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
strongSelf
.
captureHelper
.
onlyCapture
=
NO
;
strongSelf
.
captureHelper
.
onlyCapture
=
NO
;
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
0
.
5
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
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_resumeAudioCapture
];
[
strongSelf
.
captureHelper
fus_res
umeCapture
];
[
strongSelf
.
captureHelper
fus_res
tartStreamPush
];
strongSelf
.
captureHelper
.
mute
=
!
strongSelf
.
localMicEnable
;
//索隆:声音问题最难搞~~,这里使用ttsdk开播的时候记得要重新设置
strongSelf
.
captureHelper
.
mute
=
!
strongSelf
.
localMicEnable
;
//索隆:声音问题最难搞~~,这里使用ttsdk开播的时候记得要重新设置
});
});
...
@@ -782,7 +782,8 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
...
@@ -782,7 +782,8 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
-
(
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
&&
[
FUSLiveHelper
shareInstance
].
liveType
==
FUSLiveTypeAudience
)
{
[
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
)
{
if
(
playView
.
playerVideoFrameCallBackHandler
)
{
playView
.
playerVideoFrameCallBackHandler
([
NSString
stringWithFormat
:
@"%zd"
,
uid
],
videoFrame
.
pixelBuffer
);
playView
.
playerVideoFrameCallBackHandler
([
NSString
stringWithFormat
:
@"%zd"
,
uid
],
videoFrame
.
pixelBuffer
);
}
}
...
@@ -823,7 +824,8 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
...
@@ -823,7 +824,8 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
if
(
uid
==
[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
roomId
.
integerValue
&&
if
(
uid
==
[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
roomId
.
integerValue
&&
[
FUSLiveHelper
shareInstance
].
liveType
==
FUSLiveTypeAudience
)
{
[
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
];
AgoraRtcVideoCanvas
*
otherCanvas
=
[[
AgoraRtcVideoCanvas
alloc
]
init
];
otherCanvas
.
uid
=
[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
roomId
.
integerValue
;
otherCanvas
.
uid
=
[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
roomId
.
integerValue
;
...
@@ -840,7 +842,7 @@ NSString * const kLiveLinkMicRoleDidChanged = @"linkMicRoleChange";
...
@@ -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
];
[
engine
setVideoFrameDelegate
:
self
];
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment