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
3455844c
authored
Mar 07, 2026
by
suolong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改下mainviewcontroller的结构 对齐firefly
parent
187f7b27
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
488 additions
and
279 deletions
DevelopmentPods/FUSCommon/FUSCommon/Classes/Foundation/Socket/SocketMessage/FUSSocketMessageDelegate.h
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/Controller/FUSLiveMainViewController.m
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/FUSLiveFunctionView.h
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/FUSLiveFunctionView.m
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/Push/FUSLivePushPrepareView.h
DevelopmentPods/FUSCommon/FUSCommon/Classes/Foundation/Socket/SocketMessage/FUSSocketMessageDelegate.h
View file @
3455844c
...
@@ -115,6 +115,10 @@
...
@@ -115,6 +115,10 @@
#define ROOM_CID_LIVE_ALERT 10090 // 接收到直播弹窗通知
#define ROOM_CID_LIVE_ALERT 10090 // 接收到直播弹窗通知
#define ROOM_CID_WEBVIEW_PUSH 10092 // 推送webview弹窗
#define ROOM_CID_WEBVIEW_PUSH 10092 // 推送webview弹窗
// 主播打开关闭麦克风socket
#define ROOM_CID_anchorDidCloseBeauty 20200
// 主播打开关闭麦克风socket
#define ROOM_CID_anchorDidCloseMic 20201
// 更新本场直播主题内容socket
// 更新本场直播主题内容socket
#define ROOM_CID_LiveThemeDidChanged 20202
#define ROOM_CID_LiveThemeDidChanged 20202
...
@@ -126,5 +130,3 @@
...
@@ -126,5 +130,3 @@
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/Controller/FUSLiveMainViewController.m
View file @
3455844c
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#import "FUSLiveMainViewController.h"
#import "FUSLiveMainViewController.h"
#import "FUSLiveManagerViewController.h"
#import "FUSLiveManagerViewController.h"
#import "FUSLiveQuickChatSetAlertView.h"
#import "FUSLivePushPrepareView.h"
#import "FUSLivePushPrepareView.h"
#import "FUSLiveHttpHelper.h"
#import "FUSLiveHttpHelper.h"
#import "FUSSocketMessageDelegate.h"
#import "FUSSocketMessageDelegate.h"
...
@@ -62,6 +62,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -62,6 +62,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
@property
(
nonatomic
,
strong
)
UIButton
*
joinMicroBtn
;
@property
(
nonatomic
,
strong
)
UIButton
*
joinMicroBtn
;
@property
(
nonatomic
,
strong
)
UIVisualEffectView
*
passwordBlurView
;
/**
/**
设置 Idle Time Disable 的Timer
设置 Idle Time Disable 的Timer
*/
*/
...
@@ -131,7 +132,12 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -131,7 +132,12 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
@property
(
nonatomic
,
assign
)
BOOL
isClickCloseBtn
;
@property
(
nonatomic
,
assign
)
BOOL
isClickCloseBtn
;
// pk的时候,在画面下方显示的背景,防止画面还没显示出来一片黑的问题
// pk的时候,在画面下方显示的背景,防止画面还没显示出来一片黑的问题
//@property (nonatomic, strong) FUSPKBottomUserHeaderView *pkHeaderView;
@property
(
nonatomic
,
strong
)
FUSPKBottomUserHeaderView
*
pkHeaderView
;
// 码率 Image View
@property
(
nonatomic
,
strong
)
UIImageView
*
bitrateImageView
;
// 码率 Label
@property
(
nonatomic
,
strong
)
UILabel
*
bitrateLabel
;
@property
(
nonatomic
,
strong
)
VELPictureInPictureController
*
pipController
;
@property
(
nonatomic
,
strong
)
VELPictureInPictureController
*
pipController
;
/// pic in pic 启动成功回调
/// pic in pic 启动成功回调
...
@@ -201,7 +207,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -201,7 +207,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
self
.
autoStartPictureInPicture
=
FUSSwiftLiveHelper
.
shared
.
autoStartPictureInPicture
;
self
.
autoStartPictureInPicture
=
FUSSwiftLiveHelper
.
shared
.
autoStartPictureInPicture
;
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
FUSLiveNotificationKeys
.
fus_liveRoomViewDidAppear
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
FUSLiveNotificationKeys
.
fus_liveRoomViewDidAppear
object
:
nil
];
//
[self fus_setupPreloadingPlayers];
[
self
fus_setupPreloadingPlayers
];
FUSSwiftLiveHelper
.
shared
.
oc_liveRoomLifeCycle
=
FUSLiveRoomVCLifeCycleAppear
;
FUSSwiftLiveHelper
.
shared
.
oc_liveRoomLifeCycle
=
FUSLiveRoomVCLifeCycleAppear
;
}
}
...
@@ -581,10 +587,9 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -581,10 +587,9 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
-
(
void
)
initLiveFunctionView
{
-
(
void
)
initLiveFunctionView
{
_isClickCloseBtn
=
NO
;
_isClickCloseBtn
=
NO
;
[
self
fus_initContentView
];
// 防止多次创建 LiveFunctionView
// 防止多次创建 LiveFunctionView
if
(
_liveFunctionView
)
{
if
(
_liveFunctionView
)
{
// [_liveFunctionView removeFromSuperview];
[
self
.
contentView
addSubview
:
_liveFunctionView
];
[
self
.
contentView
addSubview
:
_liveFunctionView
];
return
;
return
;
}
}
...
@@ -599,8 +604,13 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -599,8 +604,13 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
*/
*/
-
(
void
)
initStreamView
-
(
void
)
initStreamView
{
{
if
([
FUSLiveHelper
shareInstance
].
liveRoomType
==
FUSRoomTypeLinkMic
)
{
[
self
fus_initContentView
];
return
;
if
(
FUSLiveHelper
.
shareInstance
.
liveRTCData
.
rtcType
==
1
)
{
if
(
FUSSwiftLiveHelper
.
shared
.
roomType
==
OBSRoom
||
FUSSwiftLiveHelper
.
shared
.
liveRoomType
==
FUSRoomTypeLinkMic
)
{
return
;
}
}
}
switch
(
FUSLiveHelper
.
shareInstance
.
liveType
)
{
switch
(
FUSLiveHelper
.
shareInstance
.
liveType
)
{
...
@@ -643,14 +653,14 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -643,14 +653,14 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
case
FUSLiveTypeAudience
:
case
FUSLiveTypeAudience
:
{
{
// self.preRoomPlayView = [[YA
StreamPlayView alloc] initWithFrame:self.scrollView.bounds];
self
.
preRoomPlayView
=
[[
FUS
StreamPlayView
alloc
]
initWithFrame
:
self
.
scrollView
.
bounds
];
//
self.preRoomPlayView.hidden = YES;
self
.
preRoomPlayView
.
hidden
=
YES
;
//
[self.scrollView addSubview:self.preRoomPlayView];
[
self
.
scrollView
addSubview
:
self
.
preRoomPlayView
];
//
// self.nextRoomPlayView = [[YA
StreamPlayView alloc] initWithFrame:self.scrollView.bounds];
self
.
nextRoomPlayView
=
[[
FUS
StreamPlayView
alloc
]
initWithFrame
:
self
.
scrollView
.
bounds
];
//
self.nextRoomPlayView.hidden = YES;
self
.
nextRoomPlayView
.
hidden
=
YES
;
//
self.nextRoomPlayView.y = self.scrollView.height * 2;
self
.
nextRoomPlayView
.
y
=
self
.
scrollView
.
height
*
2
;
//
[self.scrollView addSubview:self.nextRoomPlayView];
[
self
.
scrollView
addSubview
:
self
.
nextRoomPlayView
];
// 搭建观众端拉流 View
// 搭建观众端拉流 View
_streamView
=
[[
FUSLiveStreamView
alloc
]
initPlayViewWithFrame
:
self
.
contentView
.
bounds
];
_streamView
=
[[
FUSLiveStreamView
alloc
]
initPlayViewWithFrame
:
self
.
contentView
.
bounds
];
...
@@ -658,10 +668,10 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -658,10 +668,10 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
[
_streamView
.
playView
fus_setVideoframeCallBackOpen
:
self
.
autoStartPictureInPicture
forUid
:
self
.
streamView
.
playView
.
mainUID
];
[
_streamView
.
playView
fus_setVideoframeCallBackOpen
:
self
.
autoStartPictureInPicture
forUid
:
self
.
streamView
.
playView
.
mainUID
];
[
_contentView
addSubview
:
_streamView
];
[
_contentView
addSubview
:
_streamView
];
[
FUSLiveHelper
shareInstance
].
streamView
=
_streamView
;
[
FUSLiveHelper
shareInstance
].
streamView
=
_streamView
;
if
(
_streamURL
)
{
[
_streamView
.
playView
fus_playWithUID
:[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
roomId
Url
:
_streamURL
];
if
(
self
.
autoStartPictureInPicture
)
{
[
self
setupPictureInPicture
];
}
}
_playView
=
_streamView
.
playView
;
// 进入包房成功提示送礼view通知
// 进入包房成功提示送礼view通知
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
recieveJoinRoomSuccessNotification
)
name
:
FUSLiveUDKeys
.
fus_IS_JOIN_ROOM_SUCCESS
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
recieveJoinRoomSuccessNotification
)
name
:
FUSLiveUDKeys
.
fus_IS_JOIN_ROOM_SUCCESS
object
:
nil
];
...
@@ -699,8 +709,94 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -699,8 +709,94 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
[
weakSelf
fus_startPush
];
[
weakSelf
fus_startPush
];
};
};
// OBS 推流成功回调
[
pushPrepareView
setObsPushSuccessHandler
:
^
{
[
weakSelf
.
backgroundImageView
fus_setImageWithName
:
@"live_start_obs_bg"
];
//
FUSSwiftLiveHelper
.
shared
.
roomType
=
OBSRoom
;
FUSSwiftLiveHelper
.
shared
.
isStartedLive
=
YES
;
// 开播成功
[
weakSelf
.
pushPrepareView
removeFromSuperview
];
weakSelf
.
pushPrepareView
=
nil
;
[
FUSLiveHelper
shareInstance
].
isInStartLiveView
=
NO
;
// 移除推流 View
[
weakSelf
.
pushView
removeFromSuperview
];
[
weakSelf
.
pushView
.
captureHelper
fus_stopStreamPush
];
weakSelf
.
pushView
=
nil
;
//因为正常直播的时候,是不会创建 playView 的
[
weakSelf
initPlayView
];
[
weakSelf
fus_showLiveLoadingViewWithType
:
liveLoadingEntering
];
//服务器启动推流
[
FUSLiveHttpHelper
fus_startPushStreamWithRoomId
:[[[
FUSLiveHelper
shareInstance
]
roomInfoModel
]
roomId
]
vdoid
:[[[
FUSLiveHelper
shareInstance
]
streamModel
]
vdoid
]
livingWay
:
@"0"
liveScope
:
[
FUSLiveHelper
shareInstance
].
roomScopeType
success
:^
(
NSDictionary
*
dict
){
[
FUSLiveHttpHelper
fus_enterRoomWithRoomId
:[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
roomId
vdoid
:[
FUSLiveHelper
shareInstance
].
streamModel
.
vdoid
behaviorSrc
:
@""
password
:
@""
success
:^
(
FUSRoomInfoModel
*
roomInfoModel
,
BOOL
micMode
,
NSString
*
streamUrl
,
NSString
*
pkInfo
)
{
if
(
!
[
roomInfoModel
.
roomId
isEqualToString
:[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
roomId
])
{
FUSLogInfo
(
@"不是当前包房"
);
return
;
}
// PKview更新
if
(
pkInfo
.
integerValue
==
1
)
{
//在pk中
// 审核下不显示PK
if
(
FUSConfig
.
sharedInstanced
.
devConfigs
.
appStatus
)
return
;
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
1
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
FUSSwiftLiveHelper
.
shared
.
pkHelper
getRoomPKInfoWithRoomId
:
FUSSwiftLiveHelper
.
shared
.
roomInfoModel
.
roomId
reconnect
:
1
];
});
}
[
weakSelf
.
playView
fus_playWithUID
:
FUSSwiftLiveHelper
.
shared
.
roomInfoModel
.
roomId
Url
:
streamUrl
];
if
(
FUSSwiftLiveHelper
.
shared
.
roomInfoModel
)
{
[
FUSSwiftLiveHelper
.
shared
.
roomInfoModel
fus_setupWithModel
:
roomInfoModel
];
}
else
{
FUSSwiftLiveHelper
.
shared
.
roomInfoModel
=
roomInfoModel
;
}
[
self
.
liveFunctionView
fus_setupWithRoomInfoModel
:
roomInfoModel
];
[
FUSSocketMessageHelper
fus_socketRoomConnectWithRoomId
:
roomInfoModel
.
roomId
];
if
([
roomInfoModel
.
livestate
intValue
]
==
1
)
{
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
FUSLiveNotificationKeys
.
fus_LIVE_STATE_CHANGE
object
:
@"1"
];
}
// 拉取在线用户列表
[
FUSLiveHttpHelper
fus_requestRoomOnlineUsersWithRoomId
:[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
roomId
count
:
@"0"
success
:^
(
NSArray
*
usersArr
)
{
[
weakSelf
.
liveFunctionView
fus_setupOnlineUsers
:
usersArr
];
}
failure
:^
(
NSString
*
msg
,
int
code
)
{
FUSLogError
(
@"拉取在线用户列表失败:%@"
,
msg
);
}];
}
failure
:^
(
NSDictionary
*
errorDict
,
NSString
*
msg
,
int
code
)
{
[
FUSDialogView
fus_showDialog
:
msg
];
}];
}
failure
:^
(
NSString
*
msg
,
int
code
)
{
if
(
FUSConfig
.
sharedInstanced
.
liveConfigs
.
isAnchor
)
{
[
FUSAlertView
showAlertWithTitle
:
nil
message
:
msg
cancelButtonTitle
:
[
NSString
fus_localString
:
@"确定"
]
otherButtonTitles
:
nil
clickBlock
:^
(
NSInteger
buttonIndex
)
{}];
}
}];
[
weakSelf
initLiveFunctionView
];
}];
// 检查是否已经拥有麦克风/摄像头权限
// 检查是否已经拥有麦克风/摄像头权限
if
([
[
FUSLiveHelper
shareInstance
]
isAlreadyCheckAuths
])
{
if
([
FUSSwiftLiveHelper
.
shared
isAlreadyCheckAuths
])
{
// 有权限
// 有权限
[
self
initPushView
];
[
self
initPushView
];
[
pushPrepareView
initPushStartView
];
[
pushPrepareView
initPushStartView
];
...
@@ -787,36 +883,13 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -787,36 +883,13 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
//服务器启动推流
//服务器启动推流
[
FUSLiveHttpHelper
fus_startPushStreamWithRoomId
:[[[
FUSLiveHelper
shareInstance
]
roomInfoModel
]
roomId
]
vdoid
:[[[
FUSLiveHelper
shareInstance
]
streamModel
]
vdoid
]
livingWay
:
@"0"
liveScope
:
[
FUSLiveHelper
shareInstance
].
roomScopeType
success
:^
(
NSDictionary
*
dict
){
[
FUSLiveHttpHelper
fus_startPushStreamWithRoomId
:[[[
FUSLiveHelper
shareInstance
]
roomInfoModel
]
roomId
]
vdoid
:[[[
FUSLiveHelper
shareInstance
]
streamModel
]
vdoid
]
livingWay
:
@"0"
liveScope
:
[
FUSLiveHelper
shareInstance
].
roomScopeType
success
:^
(
NSDictionary
*
dict
){
// [self initWaterMark];
if
(
!
FUSBeautyHelper
.
shareInstance
.
faceBeautyOpened
)
{
[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
channelId
=
[
dict
[
@"channelId"
]
description
];
FUSSocketMessageModel
*
model
=
[[
FUSSocketMessageModel
alloc
]
init
];
model
.
extend1
=
FUSSwiftLiveHelper
.
shared
.
roomInfoModel
.
roomId
.
intValue
;
[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
stateSwitch
=
[
FUSLiveRoomStateSwitchModel
modelWithDictionary
:
dict
[
@"stateSwitch"
]];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
STR
(
ROOM_CID_anchorDidCloseBeauty
)
object
:
model
];
[
FUSCacheDataShare
shareStore
].
userBanScreenShot
=
[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
stateSwitch
.
screenshotState
;
if
(
FUSConfig
.
sharedInstanced
.
devConfigs
.
enableTestCode
)
{
[
FUSDialogView
fus_showDialog
:[
NSString
stringWithFormat
:
@"测试:%@"
,[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
channelId
]];
}
}
[
weakSelf
fus_startPushSucceedWithDict
:
dict
];
// [[FUSLiveHelper shareInstance].currentFunctionView fus_refreshChatBtnWithPKState:[dict[@"isShowPk"] description]];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
FUSLiveNotificationKeys
.
fus_FUS_LIVE_ROOM_SHOW_PKBTN
object
:[
dict
[
@"isShowPk"
]
description
]];
[[
FUSLiveHelper
shareInstance
].
currentFunctionView
fus_startRecordLiveTimeWithTime
:[
dict
[
@"livetime"
]
description
]];
// 调用主播加入直播间
[
weakSelf
fus_enterRoom
];
[
FUSLiveHelper
shareInstance
].
isStartedLive
=
YES
;
// 更新直播状态
[
FUSLiveHttpHelper
fus_changeLiveStateWithRoomId
:[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
roomId
state
:
@"0"
success
:
nil
failure
:
nil
];
[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
channelId
=
[
dict
[
@"channelId"
]
description
];
if
(
FUSConfig
.
sharedInstanced
.
devConfigs
.
enableTestCode
)
{
[
FUSDialogView
fus_showDialog
:[
NSString
stringWithFormat
:
@"测试:%@"
,[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
channelId
]];
}
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
FUSLiveUDKeys
.
fus_IS_JOIN_ROOM_SUCCESS
object
:
nil
];
}
failure
:^
(
NSString
*
msg
,
int
code
)
{
}
failure
:^
(
NSString
*
msg
,
int
code
)
{
if
(
FUSConfig
.
sharedInstanced
.
liveConfigs
.
isAnchor
)
{
if
(
FUSConfig
.
sharedInstanced
.
liveConfigs
.
isAnchor
)
{
[
FUSAlertView
showAlertWithTitle
:
nil
message
:
msg
cancelButtonTitle
:
[
NSString
fus_localString
:
@"确定"
]
otherButtonTitles
:
nil
clickBlock
:^
(
NSInteger
buttonIndex
)
{}];
[
FUSAlertView
showAlertWithTitle
:
nil
message
:
msg
cancelButtonTitle
:
[
NSString
fus_localString
:
@"确定"
]
otherButtonTitles
:
nil
clickBlock
:^
(
NSInteger
buttonIndex
)
{}];
...
@@ -837,8 +910,85 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -837,8 +910,85 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
[
self
initLiveFunctionView
];
[
self
initLiveFunctionView
];
}
}
-
(
void
)
fus_startPushSucceedWithDict
:
(
NSDictionary
*
)
dict
{
[
self
.
liveFunctionView
fus_LivePushSuccess
];
FUSSwiftLiveHelper
.
shared
.
roomInfoModel
.
channelId
=
[
dict
[
@"channelId"
]
description
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
FUSLiveNotificationKeys
.
fus_FUS_LIVE_ROOM_SHOW_PKBTN
object
:[
dict
[
@"isShowPk"
]
description
]];
[
self
initPushStateView
];
[
FUSSwiftLiveHelper
.
shared
.
currentFunctionView
fus_startRecordLiveTimeWithTime
:[
dict
[
@"livetime"
]
description
]];
// 调用主播加入直播间
[
self
fus_enterRoom
];
FUSSwiftLiveHelper
.
shared
.
isStartedLive
=
YES
;
[
FUSLiveHttpHelper
fus_changeLiveStateWithRoomId
:[[[
FUSLiveHelper
shareInstance
]
roomInfoModel
]
roomId
]
state
:
@"0"
success
:^
{
}
failure
:^
(
NSString
*
msg
,
int
code
)
{
}];
FUSSwiftLiveHelper
.
shared
.
roomInfoModel
.
channelId
=
[
dict
[
@"channelId"
]
description
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
FUSLiveUDKeys
.
fus_IS_JOIN_ROOM_SUCCESS
object
:
@
(
YES
)];
__weak
typeof
(
self
)
weakSelf
=
self
;
self
.
streamView
.
pushView
.
captureHelper
.
completionHandler
=
^
(
FUSStreamSessionState
feedback
)
{
switch
(
feedback
)
{
case
FUSStreamSessionStateStarted
:
[
NSObject
cancelPreviousPerformRequestsWithTarget
:
weakSelf
selector
:
@selector
(
fus_delayStartReconnectedLoading
)
object
:
nil
];
[
weakSelf
fus_showLiveLoadingViewWithType
:
liveLoadingDismiss
];
break
;
case
FUSStreamSessionStateStarting
:
case
FUSStreamSessionStateEnded
:
case
FUSStreamSessionStateNone
:
break
;
case
FUSStreamSessionStateReconnecting
:
case
FUSStreamSessionStateError
:
case
FUSStreamSessionStateUrlerr
:{
[
NSObject
cancelPreviousPerformRequestsWithTarget
:
weakSelf
selector
:
@selector
(
fus_delayStartReconnectedLoading
)
object
:
nil
];
[
weakSelf
performSelector
:
@selector
(
fus_delayStartReconnectedLoading
)
withObject
:
nil
afterDelay
:
5
];
break
;
}
}
};
}
-
(
void
)
fus_delayStartReconnectedLoading
{
[
self
fus_showLiveLoadingViewWithType
:
liveLoadingPushReconnecting
];
}
/**
/**
创建直播推流的速度
*/
-
(
void
)
initPushStateView
{
CGFloat
bitrateImageWidth
=
15
.
0
;
if
(
!
_bitrateImageView
)
{
_bitrateImageView
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
self
.
pushView
.
width
-
4
-
bitrateImageWidth
,
HEAD_VIEW_HEIGHT
-
50
,
bitrateImageWidth
,
bitrateImageWidth
)];
_bitrateImageView
.
contentMode
=
UIViewContentModeScaleAspectFit
;
_bitrateImageView
.
image
=
[
FUSShowRoomCenterBunble
imageNamed
:
@"live_push_bitrate_icon"
];
_bitrateImageView
.
alpha
=
0
;
[
self
.
pushView
addSubview
:
_bitrateImageView
];
}
if
(
!
_bitrateLabel
)
{
_bitrateLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
self
.
pushView
.
width
-
_bitrateImageView
.
width
-
10
,
20
)];
_bitrateLabel
.
textAlignment
=
NSTextAlignmentRight
;
_bitrateLabel
.
font
=
[
UIFont
fus_themeFont
:
10
];
_bitrateLabel
.
textColor
=
[
UIColor
colorWithWhite
:
1
alpha
:
0
.
5
];
_bitrateLabel
.
centerY
=
_bitrateImageView
.
centerY
;
_bitrateLabel
.
alpha
=
0
;
[
self
.
pushView
addSubview
:
_bitrateLabel
];
}
}
/**
主播进入直播间
主播进入直播间
*/
*/
-
(
void
)
fus_enterRoom
{
-
(
void
)
fus_enterRoom
{
...
@@ -847,15 +997,9 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -847,15 +997,9 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
[
FUSLiveHttpHelper
fus_enterRoomGetPredataWithRoomId
:[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
roomId
success
:
^
(
NSDictionary
*
dataDict
)
{
[
FUSLiveHttpHelper
fus_enterRoomGetPredataWithRoomId
:[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
roomId
success
:
^
(
NSDictionary
*
dataDict
)
{
NSArray
*
reminderKey
=
dataDict
[
@"reminderKey"
];
NSArray
*
reminderKey
=
dataDict
[
@"reminderKey"
];
NSDictionary
*
roomInfo
=
dataDict
[
@"roomInfo"
];
if
([
roomInfo
[
@"uid"
]
integerValue
]
!=
[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
roomId
.
integerValue
)
{
FUSLogInfo
(
@"不是当前包房"
);
return
;
}
[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
reminderKeys
=
reminderKey
;
[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
reminderKeys
=
reminderKey
;
[
s
elf
.
liveFunctionView
.
chatTableView
fus_addEnterRoomSystemTipMessage
];
[
weakS
elf
.
liveFunctionView
.
chatTableView
fus_addEnterRoomSystemTipMessage
];
[
weakSelf
.
liveFunctionView
.
pusherChatTableView
fus_addEnterRoomSystemTipMessage
];
[
FUSLiveHttpHelper
fus_enterRoomWithRoomId
:[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
roomId
vdoid
:[
FUSLiveHelper
shareInstance
].
streamModel
.
vdoid
behaviorSrc
:
@""
password
:
@""
success
:^
(
FUSRoomInfoModel
*
roomInfoModel
,
BOOL
micMode
,
NSString
*
streamUrl
,
NSString
*
pkInfo
)
{
[
FUSLiveHttpHelper
fus_enterRoomWithRoomId
:[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
roomId
vdoid
:[
FUSLiveHelper
shareInstance
].
streamModel
.
vdoid
behaviorSrc
:
@""
password
:
@""
success
:^
(
FUSRoomInfoModel
*
roomInfoModel
,
BOOL
micMode
,
NSString
*
streamUrl
,
NSString
*
pkInfo
)
{
...
@@ -868,15 +1012,6 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -868,15 +1012,6 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
if
(
pkInfo
.
integerValue
==
1
)
{
//在pk中
if
(
pkInfo
.
integerValue
==
1
)
{
//在pk中
// 审核下不显示PK
// 审核下不显示PK
if
(
FUSConfig
.
sharedInstanced
.
devConfigs
.
appStatus
)
return
;
if
(
FUSConfig
.
sharedInstanced
.
devConfigs
.
appStatus
)
return
;
// [FUSLiveHttpHelper fus_getRoomPKInfoWithRoomId:[FUSLiveHelper shareInstance].roomInfoModel.roomId success:^(NSString *status, NSString *remainTime, NSString *winner, NSString *content,NSString *isLikePk,NSArray<FUSPKRoomPKInfoModel *> *userlistArray,NSString *matchId) {
// if (![roomInfoModel.roomId isEqualToString:[FUSLiveHelper shareInstance].roomInfoModel.roomId]) {
// FUSLogInfo(@"不是当前包房");
// return ;
// }
// [[FUSLiveHelper shareInstance].currentFunctionView fus_setupContentViewWithStatus:status remainTime:remainTime winner:winner content:content userlistArray:userlistArray isShowEntrance:YES];
// } failure:^(NSString *msg, int code) {
// FUSLogInfo(@"@%",msg);
// }];
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
1
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
1
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
FUSSwiftLiveHelper
.
shared
.
pkHelper
getRoomPKInfoWithRoomId
:
FUSSwiftLiveHelper
.
shared
.
roomInfoModel
.
roomId
reconnect
:
1
];
[
FUSSwiftLiveHelper
.
shared
.
pkHelper
getRoomPKInfoWithRoomId
:
FUSSwiftLiveHelper
.
shared
.
roomInfoModel
.
roomId
reconnect
:
1
];
...
@@ -909,19 +1044,17 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -909,19 +1044,17 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
}
failure
:^
(
NSDictionary
*
errorDict
,
NSString
*
msg
,
int
code
)
{
}
failure
:^
(
NSDictionary
*
errorDict
,
NSString
*
msg
,
int
code
)
{
[
FUSDialogView
fus_showDialog
:
msg
];
[
FUSDialogView
fus_showDialog
:
msg
];
}];
}];
// 拉取在线用户列表
[
FUSLiveHttpHelper
fus_requestRoomOnlineUsersWithRoomId
:[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
roomId
count
:
@"0"
success
:^
(
NSArray
*
usersArr
)
{
[
self
.
liveFunctionView
fus_setupOnlineUsers
:
usersArr
];
}
failure
:^
(
NSString
*
msg
,
int
code
)
{
FUSLogError
(
@"拉取在线用户列表失败:%@"
,
msg
);
}];
}
failure
:^
(
NSDictionary
*
_Nonnull
errorDict
,
NSString
*
_Nonnull
msg
,
int
code
)
{
}
failure
:^
(
NSDictionary
*
_Nonnull
errorDict
,
NSString
*
_Nonnull
msg
,
int
code
)
{
[
FUSDialogView
fus_showDialog
:
msg
];
[
FUSDialogView
fus_showDialog
:
msg
];
}];
}];
// 拉取在线用户列表
[
FUSLiveHttpHelper
fus_requestRoomOnlineUsersWithRoomId
:[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
roomId
count
:
@"0"
success
:^
(
NSArray
*
usersArr
)
{
[
self
.
liveFunctionView
fus_setupOnlineUsers
:
usersArr
];
}
failure
:^
(
NSString
*
msg
,
int
code
)
{
FUSLogError
(
@"拉取在线用户列表失败:%@"
,
msg
);
}];
}
}
/**
/**
...
@@ -932,6 +1065,9 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -932,6 +1065,9 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
[
self
initLiveEndViewWithInfoDict
:
nil
];
[
self
initLiveEndViewWithInfoDict
:
nil
];
// 推流
// 推流
[
self
.
pushView
.
captureHelper
fus_stopStreamPush
];
[
self
.
pushView
.
captureHelper
fus_stopStreamPush
];
// ludy: 这里加了一个停止采集的,对应之前经常准备开播页面关闭会崩溃的bug
[
self
.
pushView
.
captureHelper
fus_pauseAudioCapture
];
if
(
self
.
pushView
.
streamType
==
FUSStreamTypeRTC
)
{
if
(
self
.
pushView
.
streamType
==
FUSStreamTypeRTC
)
{
__weak
typeof
(
self
)
weakSelf
=
self
;
__weak
typeof
(
self
)
weakSelf
=
self
;
[
self
.
pushView
fus_stopRTCStreamingWithCompletion
:
^
{
[
self
.
pushView
fus_stopRTCStreamingWithCompletion
:
^
{
...
@@ -940,8 +1076,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -940,8 +1076,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
}
else
{
}
else
{
self
.
pushView
=
nil
;
self
.
pushView
=
nil
;
}
}
// [self.playView fus_stopWithUID:[FUSLiveHelper shareInstance].roomInfoModel.roomId];
[
self
.
playView
fus_stopALLPlayer
];
[
self
.
playView
fus_stopALLPlayer
];
self
.
playView
=
nil
;
self
.
playView
=
nil
;
[
self
.
liveFunctionView
fus_cleanFunctionView
];
[
self
.
liveFunctionView
fus_cleanFunctionView
];
...
@@ -966,6 +1101,8 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -966,6 +1101,8 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
/// @param left
/// @param left
-
(
void
)
fus_exitRoomLeftRoom
:
(
BOOL
)
left
completed
:
(
void
(
^
)(
BOOL
succeed
))
completed
{
-
(
void
)
fus_exitRoomLeftRoom
:
(
BOOL
)
left
completed
:
(
void
(
^
)(
BOOL
succeed
))
completed
{
[
FUSSwiftLiveHelper
.
shared
.
liveMinimizeView
fus_destroy
];
_isClickCloseBtn
=
YES
;
_isClickCloseBtn
=
YES
;
[
self
.
streamView
fus_destroy
];
[
self
.
streamView
fus_destroy
];
...
@@ -1118,8 +1255,10 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -1118,8 +1255,10 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
_playView
.
mainUID
=
[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
roomId
;
_playView
.
mainUID
=
[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
roomId
;
[
_playView
fus_setVideoframeCallBackOpen
:
self
.
autoStartPictureInPicture
forUid
:
self
.
playView
.
mainUID
];
[
_playView
fus_setVideoframeCallBackOpen
:
self
.
autoStartPictureInPicture
forUid
:
self
.
playView
.
mainUID
];
self
.
scrollEnableCount
=
0
;
// self.hasEnterRoom = NO;
if
(
self
.
autoStartPictureInPicture
)
{
[
self
setupPictureInPicture
];
}
}
}
/**
/**
...
@@ -1192,121 +1331,21 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -1192,121 +1331,21 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
}
}
}
}
#pragma mark - Lazy Load
-
(
UIView
*
)
contentView
{
if
(
!
_contentView
)
{
self
.
scrollView
=
[[
FUSLiveScrollView
alloc
]
initWithFrame
:
self
.
view
.
bounds
];
_scrollView
.
contentSize
=
CGSizeMake
(
self
.
view
.
width
,
self
.
view
.
height
*
3
);
_scrollView
.
pagingEnabled
=
NO
;
_scrollView
.
showsVerticalScrollIndicator
=
NO
;
_scrollView
.
showsHorizontalScrollIndicator
=
NO
;
_scrollView
.
backgroundColor
=
[
UIColor
clearColor
];
_scrollView
.
offsetY
=
UIView
.
fus_screenH
;
_scrollView
.
delegate
=
self
;
_scrollView
.
bounces
=
NO
;
_scrollView
.
scrollsToTop
=
NO
;
[
self
.
view
addSubview
:
_scrollView
];
// 设置禁止滑动区域
self
.
scrollView
.
banScrollAreaRects
=
[
self
fus_baseBanScrollAreaRect
];
// iOS 11 下调用新方法
if
(
@available
(
iOS
11
.
0
,
*
))
{
_scrollView
.
contentInsetAdjustmentBehavior
=
UIScrollViewContentInsetAdjustmentNever
;
}
else
{
self
.
automaticallyAdjustsScrollViewInsets
=
NO
;
}
if
(
_pushPrepareView
)
{
[
self
.
view
bringSubviewToFront
:
_pushPrepareView
];
}
if
(
!
[
FUSLiveHelper
nextRoomInfoModel
]
&&
!
[
FUSLiveHelper
preRoomInfoModel
])
{
[
self
fus_setupScrollEnable
:
NO
];
}
else
{
[
self
fus_setupScrollEnable
:
YES
];
}
UIView
*
contentView
=
[[
UIView
alloc
]
initWithFrame
:
self
.
view
.
bounds
];
contentView
.
y
=
UIView
.
fus_screenH
;
contentView
.
backgroundColor
=
[
UIColor
clearColor
];
[
_scrollView
addSubview
:
contentView
];
self
.
contentView
=
contentView
;
// 搭建背景 ImageView
_backgroundImageView
=
[[
FUSBlurImageView
alloc
]
initWithFrame
:
UIView
.
fus_screenFrame
];
[
_contentView
addSubview
:
_backgroundImageView
];
_backgroundImageView
.
contentMode
=
UIViewContentModeScaleAspectFill
;
if
([[
FUSLiveHelper
shareInstance
]
liveType
]
==
FUSLiveTypeAudience
||
[
FUSLiveHelper
shareInstance
].
liveRoomType
==
FUSRoomTypeLinkMic
)
{
if
([
NSString
isNull
:[[[
FUSLiveHelper
shareInstance
]
roomInfoModel
]
face
]])
{
UIImage
*
bgImg
=
[[
FUSShowRoomCenterBunble
imageNamed
:
@"live_bg"
]
resizedImageToSize
:
CGSizeMake
(
500
,
500
)];
[
_backgroundImageView
fus_setImageWithImage
:
bgImg
];
}
else
{
[
_backgroundImageView
fus_setWebImageWithSubURLString
:[[[
FUSLiveHelper
shareInstance
]
roomInfoModel
]
face
]
placeholder
:
nil
];
}
}
else
if
([[
FUSLiveHelper
shareInstance
]
liveType
]
==
FUSLiveTypeAnchor
)
{
}
// 搭建上下滑动主播背景图
if
([[
FUSLiveHelper
shareInstance
]
liveType
]
==
FUSLiveTypeAudience
)
{
// 搭建前一个主播背景图片
self
.
preBgImageView
=
[[
FUSBlurImageView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
UIView
.
fus_screenW
,
UIView
.
fus_screenH
)];
_preBgImageView
.
userInteractionEnabled
=
YES
;
[
_scrollView
addSubview
:
_preBgImageView
];
// _preBgImageView.backgroundColor = [UIColor redColor];
_preBgImageView
.
contentMode
=
UIViewContentModeScaleAspectFill
;
if
([
NSString
isNull
:[[
FUSLiveHelper
preRoomInfoModel
]
face
]])
{
UIImage
*
bgImg
=
[[
FUSShowRoomCenterBunble
imageNamed
:
@"live_bg"
]
resizedImageToSize
:
CGSizeMake
(
500
,
500
)];
[
_preBgImageView
fus_setImageWithImage
:
bgImg
];
}
else
{
// 模糊
[
_preBgImageView
fus_setWebImageWithSubURLString
:[[
FUSLiveHelper
preRoomInfoModel
]
face
]
placeholder
:
nil
];
// 非模糊
// [[self preBgImageView] setWebImageWithSubURLString:[FUSLiveHelper preRoomInfoModel].face placeholder:nil completion:nil];
}
// 搭建下一个主播背景图片
self
.
nextBgImageView
=
[[
FUSBlurImageView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
UIView
.
fus_screenH
*
2
,
UIView
.
fus_screenW
,
UIView
.
fus_screenH
)];
_nextBgImageView
.
userInteractionEnabled
=
YES
;
[
_scrollView
addSubview
:
_nextBgImageView
];
_nextBgImageView
.
contentMode
=
UIViewContentModeScaleAspectFill
;
if
([
NSString
isNull
:[[
FUSLiveHelper
nextRoomInfoModel
]
face
]])
{
UIImage
*
bgImg
=
[[
FUSShowRoomCenterBunble
imageNamed
:
@"live_bg"
]
resizedImageToSize
:
CGSizeMake
(
500
,
500
)];
[
_nextBgImageView
fus_setImageWithImage
:
bgImg
];
}
else
{
// 模糊
[
_nextBgImageView
fus_setWebImageWithSubURLString
:[[
FUSLiveHelper
nextRoomInfoModel
]
face
]
placeholder
:
nil
];
// 非模糊
// [[self nextBgImageView] setWebImageWithSubURLString:[FUSLiveHelper nextRoomInfoModel].face placeholder:nil completion:nil];
}
if
(
!
[
FUSLiveHelper
nextRoomInfoModel
]
&&
!
[
FUSLiveHelper
preRoomInfoModel
])
{
[
self
fus_setupScrollEnable
:
NO
];
}
}
}
return
_contentView
;
}
#pragma mark - Method
#pragma mark - Method
/**
/**
设置是否可以上下滑动切换包房
设置是否可以上下滑动切换包房
*/
*/
-
(
void
)
setScrollEnableCount
:
(
NSInteger
)
scrollEnableCount
{
_scrollEnableCount
=
scrollEnableCount
;
if
(
scrollEnableCount
>
0
)
{
[
self
fus_setupScrollEnable
:
NO
];
}
else
{
[
self
fus_setupScrollEnable
:
YES
];
}
}
-
(
void
)
fus_setupScrollEnable
:
(
BOOL
)
enable
-
(
void
)
fus_setupScrollEnable
:
(
BOOL
)
enable
{
{
// 数值相同,不修改
// 数值相同,不修改
...
@@ -1453,17 +1492,23 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -1453,17 +1492,23 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
//WIFI
//WIFI
// 重连后发5555
// 重连后发5555
NSString
*
liveType
=
@"0"
;
NSString
*
liveType
=
@"0"
;
switch
([
FUSSwiftLiveHelper
.
shared
roomType
])
{
case
defaultRoom
:
liveType
=
@"0"
;
break
;
case
OBSRoom
:
liveType
=
@"1"
;
break
;
default
:
break
;
}
[
FUSSwiftLiveHelper
.
shared
fus_requestReconnectRoomWithNeedResp
:
YES
];
[
FUSLiveHttpHelper
fus_reconnectRoomWithRoomId
:[[[
FUSLiveHelper
shareInstance
]
roomInfoModel
]
roomId
]
livingType
:
liveType
vdoid
:
[[[
FUSLiveHelper
shareInstance
]
streamModel
]
vdoid
]
success
:^
(
FUSRoomInfoModel
*
roomInfoModel
)
{
if
([
FUSSwiftLiveHelper
.
shared
liveType
]
==
FUSLiveTypeAudience
)
{
[
FUSSocketMessageHelper
fus_socketRoomConnectWithRoomId
:[[[
FUSLiveHelper
shareInstance
]
roomInfoModel
]
roomId
]];
[
self
.
playView
fus_reloadPlayerWithUID
:
FUSSwiftLiveHelper
.
shared
.
roomInfoModel
.
roomId
];
}
failure
:^
(
NSString
*
msg
,
int
code
,
NSDictionary
*
errorDict
)
{
}
else
if
([
FUSSwiftLiveHelper
.
shared
liveType
]
==
FUSLiveTypeAnchor
)
{
}];
if
([[
FUSLiveHelper
shareInstance
]
liveType
]
==
FUSLiveTypeAudience
)
{
// [_playView fus_reloadPlayer];
[
_playView
fus_reloadPlayerWithUID
:[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
roomId
];
}
else
if
([[
FUSLiveHelper
shareInstance
]
liveType
]
==
FUSLiveTypeAnchor
)
{
}
}
...
@@ -1529,6 +1574,22 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -1529,6 +1574,22 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
channelId
=
@""
;
[
FUSLiveHelper
shareInstance
].
roomInfoModel
.
channelId
=
@""
;
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
FUSLiveNotificationKeys
.
fus_BaoFang_Did_End_Live_Notification
object
:[[[
FUSLiveHelper
shareInstance
]
roomInfoModel
]
roomId
]];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
FUSLiveNotificationKeys
.
fus_BaoFang_Did_End_Live_Notification
object
:[[[
FUSLiveHelper
shareInstance
]
roomInfoModel
]
roomId
]];
[
self
initLiveEndViewWithInfoDict
:
endViewDict
];
[
self
initLiveEndViewWithInfoDict
:
endViewDict
];
if
([
FUSSwiftLiveHelper
.
shared
liveType
]
==
FUSLiveTypeAudience
){
[
self
initLiveEndViewWithInfoDict
:
endViewDict
];
}
if
([
FUSSwiftLiveHelper
.
shared
liveType
]
==
FUSLiveTypeAnchor
)
{
NSNumber
*
causeType
=
dict
[
@"causeType"
];
NSString
*
causeString
=
dict
[
@"causeText"
];
if
(
causeType
.
intValue
==
0
)
{
[
self
initLiveEndViewWithInfoDict
:
dict
];
}
else
{
[
self
initLiveEndViewWithInfoDict
:
nil
];
[
FUSDialogView
fus_showDialog
:
causeString
];
}
}
}
}
// 被踢出直播
// 被踢出直播
...
@@ -1546,12 +1607,20 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -1546,12 +1607,20 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
NSString
*
liveType
=
@"0"
;
NSString
*
liveType
=
@"0"
;
switch
([
FUSSwiftLiveHelper
.
shared
roomType
])
{
case
defaultRoom
:
liveType
=
@"0"
;
break
;
case
OBSRoom
:
liveType
=
@"1"
;
break
;
default
:
break
;
}
[
FUSSwiftLiveHelper
.
shared
fus_requestReconnectRoomWithNeedResp
:
YES
];
[
FUSSwiftLiveHelper
.
shared
fus_requestReconnectRoomWithNeedResp
:
YES
];
// [FUSLiveHttpHelper fus_exitRoomWithRoomId:[[[FUSLiveHelper shareInstance] roomInfoModel] roomId] livingType:liveType vdoid:[[[FUSLiveHelper shareInstance] streamModel] vdoid] success:^(NSDictionary *dataDict) {
// [[FUSLiveHelper shareInstance].currentFunctionView.pkHelper fus_removeAllNotification];
// } failure:^(NSString *msg, int code, NSDictionary *errorDict) {
//
// }];
}
}
...
@@ -1781,7 +1850,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -1781,7 +1850,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
}
}
[
FUSSwiftLiveHelper
.
shared
fus_requestReconnectRoomWithNeedResp
:
YES
];
[
FUSSwiftLiveHelper
.
shared
fus_requestReconnectRoomWithNeedResp
:
YES
];
if
(
FUSSwiftLiveHelper
.
shared
.
liveType
==
FUSLiveTypeA
udience
)
{
if
(
FUSSwiftLiveHelper
.
shared
.
liveType
==
FUSLiveTypeA
nchor
)
{
if
([
FUSSwiftLiveHelper
.
shared
roomType
]
==
OBSRoom
)
{
if
([
FUSSwiftLiveHelper
.
shared
roomType
]
==
OBSRoom
)
{
return
;
return
;
}
else
{
}
else
{
...
@@ -1869,16 +1938,16 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -1869,16 +1938,16 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
}
}
-
(
void
)
fus_liveFunctionView
:
(
FUSLiveFunctionView
*
)
functionView
pkViewDidAddedWithInfoList
:
(
NSArray
<
FUSPKRoomPKInfoModel
*>
*
)
pkInfoList
{
-
(
void
)
fus_liveFunctionView
:
(
FUSLiveFunctionView
*
)
functionView
pkViewDidAddedWithInfoList
:
(
NSArray
<
FUSPKRoomPKInfoModel
*>
*
)
pkInfoList
{
//
[self.pkHeaderView removeFromSuperview];
[
self
.
pkHeaderView
removeFromSuperview
];
//
CGRect frame = [self.playView fus_frameForUID:pkInfoList.firstObject.uid];
CGRect
frame
=
[
self
.
playView
fus_frameForUID
:
pkInfoList
.
firstObject
.
uid
];
//
frame.size.width = self.playView.width;
frame
.
size
.
width
=
self
.
playView
.
width
;
//
self.pkHeaderView = [[FUSPKBottomUserHeaderView alloc] initWithFrame:frame userlistArray:pkInfoList];
self
.
pkHeaderView
=
[[
FUSPKBottomUserHeaderView
alloc
]
initWithFrame
:
frame
userlistArray
:
pkInfoList
];
//
[self.playView.superview insertSubview:self.pkHeaderView belowSubview:self.playView];
[
self
.
playView
.
superview
insertSubview
:
self
.
pkHeaderView
belowSubview
:
self
.
playView
];
}
}
-
(
void
)
fus_liveFunctionViewPkViewDidRemoved
:
(
FUSLiveFunctionView
*
)
functionView
{
-
(
void
)
fus_liveFunctionViewPkViewDidRemoved
:
(
FUSLiveFunctionView
*
)
functionView
{
//
[self.pkHeaderView removeFromSuperview];
[
self
.
pkHeaderView
removeFromSuperview
];
//
self.pkHeaderView = nil;
self
.
pkHeaderView
=
nil
;
}
}
/**
/**
...
@@ -2168,6 +2237,16 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -2168,6 +2237,16 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
[
self
.
view
addSubview
:
setThemeView
];
[
self
.
view
addSubview
:
setThemeView
];
}
}
-
(
void
)
fus_showQuickChatEditView
{
[
FUSLiveQuickChatSetAlertView
fus_showOn
:[[
FUSLiveHelper
shareInstance
].
currentFunctionView
fus_viewWithLayer
:
FUSLiveFunctionLayerManualPopView
]
clickHandler
:
^
{
}];
}
-
(
void
)
ffshowFollowSalutationView
{
}
/**
/**
弹出推流质量的View
弹出推流质量的View
*/
*/
...
@@ -2333,15 +2412,14 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -2333,15 +2412,14 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
if
([
self
.
playView
.
mainUID
isEqual
:
mainUid
])
{
if
([
self
.
playView
.
mainUID
isEqual
:
mainUid
])
{
return
self
.
playView
;
return
self
.
playView
;
}
}
if
([
self
.
preRoomPlayView
.
mainUID
isEqual
:
mainUid
])
{
return
self
.
preRoomPlayView
;
}
//TODO: 索隆 - V57
if
([
self
.
nextRoomPlayView
.
mainUID
isEqual
:
mainUid
])
{
// if ([self.preRoomPlayView.mainUID isEqual:mainUid]) {
return
self
.
nextRoomPlayView
;
// return self.preRoomPlayView;
}
// }
//
// if ([self.nextRoomPlayView.mainUID isEqual:mainUid]) {
// return self.nextRoomPlayView;
// }
return
nil
;
return
nil
;
}
}
...
@@ -2349,44 +2427,159 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -2349,44 +2427,159 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
-
(
void
)
fus_showPasswordBlurView
{
-
(
void
)
fus_showPasswordBlurView
{
// self.passwordBlurView = [[UIVisualEffectView alloc] initWithFrame:self.view.bounds];
self
.
passwordBlurView
=
[[
UIVisualEffectView
alloc
]
initWithFrame
:
self
.
view
.
bounds
];
// self.passwordBlurView.effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
self
.
passwordBlurView
.
effect
=
[
UIBlurEffect
effectWithStyle
:
UIBlurEffectStyleDark
];
// self.passwordBlurView.alpha = 1;
self
.
passwordBlurView
.
alpha
=
1
;
// [self.view addSubview:self.passwordBlurView];
[
self
.
view
addSubview
:
self
.
passwordBlurView
];
}
-
(
void
)
fus_updatePlayingView
:
(
BOOL
)
showNextPlayer
{
if
(
showNextPlayer
==
NO
)
{
[
self
.
preRoomPlayView
removeFromSuperview
];
[
self
.
streamView
addSubview
:
self
.
preRoomPlayView
];
self
.
preRoomPlayView
.
frame
=
self
.
streamView
.
bounds
;
[
self
.
streamView
.
playView
removeFromSuperview
];
id
tempPlayView
=
self
.
streamView
.
playView
;
self
.
streamView
.
playView
=
self
.
preRoomPlayView
;
self
.
preRoomPlayView
=
tempPlayView
;
[
self
.
scrollView
addSubview
:
self
.
preRoomPlayView
];
self
.
preRoomPlayView
.
y
=
0
;
self
.
streamView
.
playView
.
hidden
=
NO
;
[
self
.
streamView
.
playView
fus_openPlayerSound
];
}
else
if
(
showNextPlayer
==
YES
)
{
[
self
.
nextRoomPlayView
removeFromSuperview
];
[
self
.
streamView
addSubview
:
self
.
nextRoomPlayView
];
self
.
nextRoomPlayView
.
frame
=
self
.
streamView
.
bounds
;
[
self
.
streamView
.
playView
removeFromSuperview
];
id
tempPlayView
=
self
.
streamView
.
playView
;
self
.
streamView
.
playView
=
self
.
nextRoomPlayView
;
self
.
nextRoomPlayView
=
tempPlayView
;
[
self
.
scrollView
addSubview
:
self
.
nextRoomPlayView
];
self
.
nextRoomPlayView
.
y
=
(
UIView
.
fus_screenH
*
2
);
self
.
streamView
.
playView
.
hidden
=
NO
;
[
self
.
streamView
.
playView
fus_openPlayerSound
];
}
__weak
typeof
(
self
)
weakSelf
=
self
;
//回调当前码率
[
self
.
playView
setPlayBitrateUpdateHandler
:
^
(
double
bitrate
)
{
[
weakSelf
.
liveFunctionView
fus_updataBitrateWithRate
:
bitrate
];
}];
if
(
self
.
pipController
)
{
self
.
pipController
.
contentView
=
self
.
playView
;
}
[
self
fus_setupPreloadingPlayers
];
}
}
-
(
void
)
fus_setupPreloadingPlayers
{
FUSRoomInfoModel
*
premodel
=
[
FUSSwiftLiveHelper
preRoomInfoModel
];
[
self
.
preRoomPlayView
fus_destroyAllPlayer
];
self
.
preRoomPlayView
.
mainUID
=
premodel
.
roomId
;
[
self
.
preRoomPlayView
fus_setupWithUID
:
premodel
.
roomId
Url
:
premodel
.
publishUrl
];
self
.
preRoomPlayView
.
isPreloadPlayer
=
YES
;
self
.
preRoomPlayView
.
hidden
=
YES
;
FUSRoomInfoModel
*
nextmodel
=
[
FUSSwiftLiveHelper
nextRoomInfoModel
];
[
self
.
nextRoomPlayView
fus_destroyAllPlayer
];
self
.
nextRoomPlayView
.
mainUID
=
nextmodel
.
roomId
;
[
self
.
nextRoomPlayView
fus_setupWithUID
:
nextmodel
.
roomId
Url
:
nextmodel
.
publishUrl
];
self
.
nextRoomPlayView
.
isPreloadPlayer
=
YES
;
self
.
nextRoomPlayView
.
hidden
=
YES
;
self
.
preloadingPlayView
=
nil
;
self
.
playView
.
isPreloadPlayer
=
YES
;
}
-
(
void
)
fus_hidePasswordBlurView
{
-
(
void
)
fus_hidePasswordBlurView
{
//
[self.passwordBlurView removeFromSuperview];
[
self
.
passwordBlurView
removeFromSuperview
];
//
self.passwordBlurView = nil;
self
.
passwordBlurView
=
nil
;
}
}
#pragma mark - ScrollView Delegate
#pragma mark - ScrollView Delegate
-
(
void
)
scrollViewDidScroll
:
(
UIScrollView
*
)
scrollView
-
(
void
)
scrollViewDidScroll
:
(
UIScrollView
*
)
scrollView
{
{
[
self
.
view
endEditing
:
YES
];
[
self
.
view
endEditing
:
YES
];
CGFloat
offsetY
=
self
.
scrollView
.
offsetY
-
self
.
beginY
;
if
(
offsetY
<
0
)
{
if
(
self
.
preloadingPlayView
!=
self
.
preRoomPlayView
)
{
self
.
preloadingPlayView
=
self
.
preRoomPlayView
;
self
.
preRoomPlayView
.
y
=
0
;
[
self
.
nextRoomPlayView
fus_pauseWithUID
:[
FUSSwiftLiveHelper
nextRoomInfoModel
].
roomId
];
[
self
.
preRoomPlayView
fus_playWithUID
:[
FUSSwiftLiveHelper
preRoomInfoModel
].
roomId
mutePlay
:
YES
];
self
.
nextRoomPlayView
.
hidden
=
YES
;
self
.
preRoomPlayView
.
hidden
=
NO
;
}
}
else
if
(
offsetY
>
0
)
{
if
(
self
.
preloadingPlayView
!=
self
.
nextRoomPlayView
)
{
self
.
preloadingPlayView
=
self
.
nextRoomPlayView
;
[
self
.
preRoomPlayView
fus_pauseWithUID
:[
FUSSwiftLiveHelper
preRoomInfoModel
].
roomId
];
[
self
.
nextRoomPlayView
fus_playWithUID
:[
FUSSwiftLiveHelper
nextRoomInfoModel
].
roomId
mutePlay
:
YES
];
self
.
nextRoomPlayView
.
y
=
(
UIView
.
fus_screenH
*
2
);
self
.
nextRoomPlayView
.
hidden
=
NO
;
self
.
preRoomPlayView
.
hidden
=
YES
;
}
}
}
}
-
(
void
)
scrollViewDidEndDecelerating
:
(
UIScrollView
*
)
scrollView
-
(
void
)
scrollViewDidEndDecelerating
:
(
UIScrollView
*
)
scrollView
{
{
if
(
_scrollView
.
offsetY
==
0
)
{
if
(
_scrollView
.
offsetY
==
0
)
{
_scrollView
.
offsetY
=
UIView
.
fus_screenH
;
_scrollView
.
offsetY
=
UIView
.
fus_screenH
;
FUSRoomInfoModel
*
model
=
[
FUSLiveHelper
preRoomInfoModel
];
// 停止播放
[[
FUSLiveHelper
shareInstance
]
fus_switchRoomWithRoomInfoModel
:
model
behaviorSrc
:
@""
success
:
nil
failure
:
nil
];
[
self
fus_stopPlay
];
[
self
fus_setupScrollEnable
:
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
;
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(.
6
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(.
6
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
self
fus_setupScrollEnable
:
YES
];
self
.
scrollEnableCount
-=
1
;
[
self
fus_setupPreloadingPlayers
];
});
});
// FUSRoomInfoModel *model = [FUSLiveHelper preRoomInfoModel];
// [[FUSLiveHelper shareInstance] fus_switchRoomWithRoomInfoModel:model behaviorSrc:@"" success:nil failure:nil];
// [self fus_setupScrollEnable:NO];
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(.6 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [self fus_setupScrollEnable:YES];
// });
}
}
if
(
_scrollView
.
offsetY
==
(
UIView
.
fus_screenH
*
2
))
{
if
(
_scrollView
.
offsetY
==
(
UIView
.
fus_screenH
*
2
))
{
_scrollView
.
offsetY
=
UIView
.
fus_screenH
;
_scrollView
.
offsetY
=
UIView
.
fus_screenH
;
FUSRoomInfoModel
*
model
=
[
FUSLiveHelper
nextRoomInfoModel
];
// 停止播放
[[
FUSLiveHelper
shareInstance
]
fus_switchRoomWithRoomInfoModel
:
model
behaviorSrc
:
@""
success
:
nil
failure
:
nil
];
[
self
fus_stopPlay
];
[
self
fus_setupScrollEnable
:
NO
];
FUSRoomInfoModel
*
model
=
[
FUSSwiftLiveHelper
nextRoomInfoModel
];
[
FUSSwiftLiveHelper
.
shared
switchRoomWithRoomInfoModel
:
model
hasPreloadVideo
:
YES
success
:
nil
failure
:
nil
];
[
self
fus_updatePlayingView
:
YES
];
// 重置数据
[
self
fus_resetData
];
self
.
scrollEnableCount
+=
1
;
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(.
6
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(.
6
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
self
fus_setupScrollEnable
:
YES
];
self
.
scrollEnableCount
-=
1
;
[
self
fus_setupPreloadingPlayers
];
});
});
// FUSRoomInfoModel *model = [FUSLiveHelper nextRoomInfoModel];
// [[FUSLiveHelper shareInstance] fus_switchRoomWithRoomInfoModel:model behaviorSrc:@"" success:nil failure:nil];
// [self fus_setupScrollEnable:NO];
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(.6 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [self fus_setupScrollEnable:YES];
// });
}
}
self
.
scrollView
.
pagingEnabled
=
NO
;
self
.
scrollView
.
pagingEnabled
=
NO
;
}
}
...
@@ -2394,11 +2587,13 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -2394,11 +2587,13 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
-
(
void
)
scrollViewWillBeginDragging
:
(
UIScrollView
*
)
scrollView
{
-
(
void
)
scrollViewWillBeginDragging
:
(
UIScrollView
*
)
scrollView
{
// pagingEnabled 如果設置了YES,那麼scrollView裡面內嵌的scrollView滾動會有問題,所以只有在當前scrollView滾動的時候才設置為yes
// pagingEnabled 如果設置了YES,那麼scrollView裡面內嵌的scrollView滾動會有問題,所以只有在當前scrollView滾動的時候才設置為yes
self
.
scrollView
.
pagingEnabled
=
YES
;
self
.
scrollView
.
pagingEnabled
=
YES
;
self
.
beginY
=
scrollView
.
offsetY
;
}
}
-
(
void
)
scrollViewDidEndDragging
:
(
UIScrollView
*
)
scrollView
willDecelerate
:
(
BOOL
)
decelerate
{
-
(
void
)
scrollViewDidEndDragging
:
(
UIScrollView
*
)
scrollView
willDecelerate
:
(
BOOL
)
decelerate
{
if
(
!
decelerate
)
{
if
(
!
decelerate
)
{
[
self
scrollViewDidEndDecelerating
:
scrollView
];
self
.
scrollView
.
pagingEnabled
=
NO
;
self
.
scrollView
.
pagingEnabled
=
NO
;
}
}
}
}
...
@@ -2513,47 +2708,48 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -2513,47 +2708,48 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
if
(
FUSLiveHelper
.
shareInstance
.
liveType
!=
FUSLiveTypeAudience
)
{
if
(
FUSLiveHelper
.
shareInstance
.
liveType
!=
FUSLiveTypeAudience
)
{
return
;
return
;
}
}
dispatch_async_on_main_queue
(
^
{
[
self
destroyPlayPictureInPicture
];
[
self
destroyPlayPictureInPicture
];
if
(
!
self
.
pipController
)
{
if
(
!
self
.
pipController
)
{
VELPictureInPictureType
pipType
=
VELPictureInPictureTypeContentSource
;
VELPictureInPictureType
pipType
=
VELPictureInPictureTypeContentSource
;
self
.
pipController
=
[[
VELPictureInPictureController
alloc
]
initWithType
:
pipType
self
.
pipController
=
[[
VELPictureInPictureController
alloc
]
initWithType
:
pipType
contentView
:[
self
playView
]];
contentView
:[
self
playView
]];
self
.
pipController
.
videoGravity
=
AVLayerVideoGravityResizeAspectFill
;
self
.
pipController
.
videoGravity
=
AVLayerVideoGravityResizeAspect
;
self
.
pipController
.
delegate
=
self
;
self
.
pipController
.
delegate
=
self
;
[
self
.
pipController
prepareWithCompletion
:
nil
];
[
self
.
pipController
prepareWithCompletion
:
nil
];
FUSLogInfo
(
@"FUSSwiftLiveHelper.shared.pkHelper.ocViewModel.currentPKState = %@"
,
FUSSwiftLiveHelper
.
shared
.
pkHelper
.
ocViewModel
.
oc_localAnchorModel
.
uid
);
FUSLogInfo
(
@"FUSSwiftLiveHelper.shared.pkHelper.ocViewModel.currentPKState = %@"
,
FUSSwiftLiveHelper
.
shared
.
pkHelper
.
ocViewModel
.
oc_localAnchorModel
.
uid
);
CGRect
rect
=
FUSSwiftLiveHelper
.
shared
.
pkHelper
.
ocViewModel
.
currentPKState
==
FUSPKStateNone
?
CGRectMake
(
0
,
0
,
UIView
.
fus_screenW
,
UIView
.
fus_screenW
*
16
/
9
)
:
CGRectMake
(
0
,
0
,
UIView
.
fus_screenW
,
UIView
.
fus_screenW
*
16
/
18
);
CGRect
rect
=
FUSSwiftLiveHelper
.
shared
.
pkHelper
.
ocViewModel
.
currentPKState
==
FUSPKStateNone
?
CGRectMake
(
0
,
0
,
UIView
.
fus_screenW
,
UIView
.
fus_screenW
*
16
/
9
)
:
CGRectMake
(
0
,
0
,
UIView
.
fus_screenW
,
UIView
.
fus_screenW
*
16
/
18
);
[
self
setPictureInPictureVideoFrame
:
rect
];
[
self
setPictureInPictureVideoFrame
:
rect
];
__weak
typeof
(
self
)
weakSelf
=
self
;
__weak
typeof
(
self
)
weakSelf
=
self
;
self
.
playView
.
playTypeDidChangedHandler
=
^
(
FUSStreamPlayViewPlayType
type
)
{
self
.
playView
.
playTypeDidChangedHandler
=
^
(
FUSStreamPlayViewPlayType
type
)
{
switch
(
type
)
{
switch
(
type
)
{
case
FUSStreamPlayViewPlayTypeNewPK
:
case
FUSStreamPlayViewPlayTypeNewPK
:
{
{
CGRect
rect
=
CGRectMake
(
0
,
0
,
UIView
.
fus_screenW
,
UIView
.
fus_screenW
*
16
/
18
);
CGRect
rect
=
CGRectMake
(
0
,
0
,
UIView
.
fus_screenW
,
UIView
.
fus_screenW
*
16
/
18
);
[
weakSelf
setPictureInPictureVideoFrame
:
rect
];
[
weakSelf
setPictureInPictureVideoFrame
:
rect
];
break
;
break
;
}
case
FUSStreamPlayViewPlayTypePK
:
case
FUSStreamPlayViewPlayTypeNormal
:
case
FUSStreamPlayViewPlayTypeLinkMic
:
[
weakSelf
setPictureInPictureVideoFrame
:
weakSelf
.
view
.
bounds
];
break
;
default
:
break
;
}
}
case
FUSStreamPlayViewPlayTypePK
:
};
case
FUSStreamPlayViewPlayTypeNormal
:
case
FUSStreamPlayViewPlayTypeLinkMic
:
[
weakSelf
setPictureInPictureVideoFrame
:
weakSelf
.
view
.
bounds
];
}
break
;
self
.
pipController
.
contentView
=
self
.
playView
;
});
default
:
break
;
}
};
}
self
.
pipController
.
contentView
=
self
.
playView
;
}
}
}
}
...
@@ -2571,8 +2767,11 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
...
@@ -2571,8 +2767,11 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
}
}
-
(
void
)
destroyPlayPictureInPicture
{
-
(
void
)
destroyPlayPictureInPicture
{
[
VELPictureInPictureController
destroyPictureInPicture
];
dispatch_async_on_main_queue
(
^
{
[
self
setPipController
:
nil
];
[
self
.
pipController
stopPictureInPicture
];
[
VELPictureInPictureController
destroyPictureInPicture
];
[
self
setPipController
:
nil
];
});
}
}
+
(
BOOL
)
isPictureInPictureStarted
{
+
(
BOOL
)
isPictureInPictureStarted
{
...
...
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/FUSLiveFunctionView.h
View file @
3455844c
...
@@ -350,6 +350,8 @@ typedef NS_ENUM(NSInteger, FUSFunctionMode) {
...
@@ -350,6 +350,8 @@ typedef NS_ENUM(NSInteger, FUSFunctionMode) {
/// 清除所有半屏弹窗
/// 清除所有半屏弹窗
-
(
void
)
fus_clearHalfWebView
;
-
(
void
)
fus_clearHalfWebView
;
/// 通知functionview推流成功(也就是主播开播成功),用于引导,改变一些状态
-
(
void
)
fus_LivePushSuccess
;
-
(
void
)
fus_reloadAllUserFromRequest
;
-
(
void
)
fus_reloadAllUserFromRequest
;
...
...
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/FUSLiveFunctionView.m
View file @
3455844c
...
@@ -5286,7 +5286,11 @@ BDAlphaPlayerMetalViewDelegate
...
@@ -5286,7 +5286,11 @@ BDAlphaPlayerMetalViewDelegate
_enterRoomInterval
+=
1
;
_enterRoomInterval
+=
1
;
}
}
/// 通知functionview推流成功(也就是主播开播成功),用于引导,改变一些状态
-
(
void
)
fus_LivePushSuccess
{
}
/**
/**
送礼提示展示逻辑
送礼提示展示逻辑
...
...
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/Push/FUSLivePushPrepareView.h
View file @
3455844c
...
@@ -13,6 +13,8 @@ typedef void(^PushSuccess)(void);
...
@@ -13,6 +13,8 @@ typedef void(^PushSuccess)(void);
@interface
FUSLivePushPrepareView
:
UIView
@interface
FUSLivePushPrepareView
:
UIView
@property
(
nonatomic
,
copy
)
PushSuccess
pushSuccessBlock
;
@property
(
nonatomic
,
copy
)
PushSuccess
pushSuccessBlock
;
// OBS 开播成功回调
@property
(
nonatomic
,
copy
)
PushSuccess
obsPushSuccessHandler
;
-
(
void
)
fus_checkDeviceAuths
;
-
(
void
)
fus_checkDeviceAuths
;
...
...
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