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
68c066f7
authored
Jul 01, 2025
by
ludi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/私享房需求' of
http://git.yabolive.net:88/pidan/FuSiLive
into feature/私享房需求
parents
35f1bfe0
c2c4ff6c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
7 deletions
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Views/StreamView/FUSByteStreamCaptureHelper.m
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/Push/LiveStartView/FUSLiveStartSetPrivacyView.swift
DevelopmentPods/FUSFoundation/FUSFoundation/Classes/FUSFoundation/Views/StreamView/FUSByteStreamCaptureHelper.m
View file @
68c066f7
...
...
@@ -46,6 +46,8 @@
@property
(
nonatomic
,
strong
)
NSLock
*
lock
;
@property
(
nonatomic
,
assign
)
AVCaptureDevicePosition
currentCameraPosition
;
@end
@implementation
FUSByteStreamCaptureHelper
...
...
@@ -60,6 +62,7 @@
// 初始化参数值
_isFirstFrame
=
YES
;
_mySwitch
=
YES
;
_currentCameraPosition
=
AVCaptureDevicePositionFront
;
[
self
initBeautyEngine
];
[
self
initStreamingSession
];
...
...
@@ -75,15 +78,18 @@
-
(
void
)
fus_becomeActiveNotification
:(
NSNotification
*
)
notification
{
AVCaptureDevicePosition
position
=
_capture
.
cameraPosition
;
if
(
!
self
.
engine
.
camera
.
isRunning
)
{
[
self
.
engine
.
camera
startCameraCapture
];
}
[
self
.
capture
startVideoCapture
];
self
.
capture
.
cameraPosition
=
self
.
currentCameraPosition
;
}
-
(
void
)
fus_resignActiveNotification
:(
NSNotification
*
)
notification
{
AVCaptureDevicePosition
position
=
_capture
.
cameraPosition
;
if
(
!
self
.
engine
.
camera
.
isRunning
)
{
[
self
.
engine
.
camera
stopCameraCapture
];
}
...
...
@@ -131,7 +137,7 @@
}
}];
_capture
.
cameraPosition
=
AVCaptureDevicePositionFront
;
_capture
.
cameraPosition
=
AVCaptureDevicePositionFront
;
_capture
.
inPixelFmt
=
kCVPixelFormatType_32BGRA
;
[
_capture
setEnableEffect
:
YES
];
[
_capture
resetPreviewView
:
self
.
previewContainer
];
...
...
@@ -162,6 +168,7 @@
[
self
.
engine
.
camera
setWhiteBalanceMode
:
AVCaptureWhiteBalanceModeContinuousAutoWhiteBalance
];
[
self
.
engine
.
camera
setExposureMode
:
AVCaptureExposureModeContinuousAutoExposure
];
[
self
.
engine
.
camera
setCaptureFocusMode
:
AVCaptureFocusModeContinuousAutoFocus
];
self
.
capture
.
cameraPosition
=
self
.
currentCameraPosition
;
}
...
...
@@ -308,6 +315,7 @@
/// 开启推流
[
self
.
engine
startStreaming
];
self
.
capture
.
cameraPosition
=
self
.
currentCameraPosition
;
}
/**
...
...
@@ -319,6 +327,16 @@
if
(
_engine
.
isStreaming
)
{
[
_engine
stopStreaming
];
}
// 背景模式
[
_engine
setEnableAudioCaptureInBackground
:
NO
];
_engine
.
liveSession
.
echoCancellationEnabled
=
NO
;
[
_engine
setEchoCancellationEnabled
:
NO
];
[
_engine
setupAudioCaptureWithConfig
:
nil
];
if
(
_engine
.
liveSession
.
configuration
)
{
[
_engine
setupLiveSessionWithConfig
:
nil
];
}
}
/**
...
...
@@ -330,21 +348,26 @@
return
;
}
// 视讯的时候只需要采集。不需要推流操作
if
(
self
.
config
.
captureType
==
FUSStreamCaptureTypeVideoChat
)
{
return
;
}
BOOL
muted
=
self
.
mute
;
// 在后台期间不做重载操作,容易导致闪退
if
([
UIApplication
sharedApplication
].
applicationState
==
UIApplicationStateBackground
)
{
return
;
}
if
(
self
.
engine
.
liveSession
.
liveSessionState
==
LiveStreamSessionStateError
||
self
.
engine
.
liveSession
.
liveSessionState
==
LiveStreamSessionStateReconnecting
)
{
if
(
self
.
engine
.
liveSession
.
liveSessionState
==
LiveStreamSessionStateReconnecting
||
self
.
engine
.
liveSession
.
liveSessionState
==
LiveStreamSessionStateStarted
||
self
.
engine
.
liveSession
.
liveSessionState
==
LiveStreamSessionStateStarting
)
{
[
self
.
engine
startStreaming
];
self
.
mute
=
muted
;
return
;
}
// 视讯的时候只需要采集。不需要推流操作
if
(
self
.
config
.
captureType
!=
FUSStreamCaptureTypeVideoChat
)
{
if
(
self
.
engine
.
liveSession
.
liveSessionState
==
LiveStreamSessionStateError
)
{
// 重新推流。先把原本的推流对象释放掉。生成新的推流对象,否则会发送推不上流的情况
[
self
fus_stopStreamPush
];
...
...
@@ -356,6 +379,9 @@
[
self
fus_startStreamPushWithUrl
:
self
.
pushUrl
completionHandler
:
self
.
completionHandler
];
self
.
mute
=
muted
;
});
}
else
{
[
self
fus_setupLiveSessionConfigs
];
[
self
fus_startStreamPushWithUrl
:
self
.
pushUrl
completionHandler
:
self
.
completionHandler
];
}
}
...
...
@@ -393,6 +419,12 @@
*/
-
(
void
)
fus_switchCamera
{
if
(
self
.
currentCameraPosition
==
AVCaptureDevicePositionBack
)
{
self
.
currentCameraPosition
=
AVCaptureDevicePositionFront
;
}
else
if
(
self
.
currentCameraPosition
==
AVCaptureDevicePositionFront
)
{
self
.
currentCameraPosition
=
AVCaptureDevicePositionBack
;
}
[
self
.
engine
.
camera
switchCamera
];
[
self
fus_offTorch
];
}
...
...
@@ -418,8 +450,10 @@
{
if
(
position
==
AVCaptureDevicePositionBack
&&
[
self
.
engine
.
camera
isFrontFacingCameraPresent
])
{
self
.
engine
.
camera
.
bMirrorRearCamera
=
position
;
self
.
currentCameraPosition
=
position
;
}
else
if
(
position
==
AVCaptureDevicePositionFront
&&
[
self
.
engine
.
camera
isBackFacingCameraPresent
])
{
self
.
engine
.
camera
.
bMirrorRearCamera
=
position
;
self
.
currentCameraPosition
=
position
;
}
}
...
...
@@ -461,6 +495,7 @@
{
if
(
enable
)
{
[
self
.
engine
.
camera
startCameraCapture
];
self
.
capture
.
cameraPosition
=
self
.
currentCameraPosition
;
}
else
{
[
self
.
engine
.
camera
stopCameraCapture
];
}
...
...
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/Push/LiveStartView/FUSLiveStartSetPrivacyView.swift
View file @
68c066f7
...
...
@@ -102,8 +102,8 @@ import FUSCommon
//这里特殊用户有不一样的逻辑
let
iconImagesList
=
[
"live_start_openScope_cell"
,
"live_start_passwordScope_cell"
/*,"live_start_intimacyScope_cell"*/
]
let
titlesList
=
[
String
.
fus_
localString
(
"公开屋"
),
.
fus_l
ocalString
(
"私享屋"
)
/*, .fus_localString("亲密圈")*/
]
let
subTitlesList
=
[
String
.
fus_localString
(
"所有人可进入房间"
),
.
fus_
localString
(
"玩家正确输入密码后可进入屋内
"
)
/*, .fus_localString("仅亲密好友可进入房间")*/
]
let
titlesList
=
[
String
.
fus_
versionLocalString
(
"公开屋"
),
.
fus_versionL
ocalString
(
"私享屋"
)
/*, .fus_localString("亲密圈")*/
]
let
subTitlesList
=
[
String
.
fus_localString
(
"所有人可进入房间"
),
.
fus_
versionLocalString
(
"已关闭窗帘,玩家输入密码打开
"
)
/*, .fus_localString("仅亲密好友可进入房间")*/
]
let
itemHeight
=
56.0
privacyContentView
.
snp
.
makeConstraints
{
make
in
...
...
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