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
7458f44b
authored
Jun 26, 2025
by
pidan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
礼物和座驾声音播放逻辑
parent
7bf1227f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
29 deletions
DevelopmentPods/FUSBDAlphaPlayer/FUSBDAlphaPlayer/Classes/BDAlphaPlayerMetalView.m
DevelopmentPods/FUSBDAlphaPlayer/FUSBDAlphaPlayer/Classes/Model/BDAlphaPlayerMetalConfiguration.h
DevelopmentPods/FUSCommon/FUSCommon/Classes/Common/FUSGiftCenter/Animtions/FUSWEBPGiftAnimation.m
DevelopmentPods/FUSCommon/FUSCommon/Classes/Common/FUSGiftCenter/DataCenter/Model/FUSMotorDataModel.m
FuSiLive.xcodeproj/project.pbxproj
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/Other/FUSCarEnterView.m
DevelopmentPods/FUSBDAlphaPlayer/FUSBDAlphaPlayer/Classes/BDAlphaPlayerMetalView.m
View file @
7458f44b
...
...
@@ -29,6 +29,10 @@
@property
(
atomic
,
assign
)
BOOL
hasDestroyed
;
@property
(
nonatomic
,
assign
)
BOOL
needPlayAudio
;
@property
(
nonatomic
,
strong
)
AVPlayer
*
audioPlayer
;
@end
@implementation
BDAlphaPlayerMetalView
...
...
@@ -63,6 +67,7 @@
NSError
*
error
=
nil
;
self
.
renderSuperViewFrame
=
configuration
.
renderSuperViewFrame
;
self
.
model
=
[
BDAlphaPlayerResourceModel
resourceModelFromDirectory
:
configuration
.
directory
orientation
:
configuration
.
orientation
error
:&
error
];
self
.
needPlayAudio
=
configuration
.
playAudio
;
if
(
error
)
{
[
self
didFinishPlayingWithError
:
error
];
return
;
...
...
@@ -103,6 +108,8 @@
-
(
void
)
didFinishPlayingWithError
:
(
NSError
*
)
error
{
[
self
.
audioPlayer
pause
];
self
.
audioPlayer
=
nil
;
self
.
state
=
BDAlphaPlayerPlayStateStop
;
if
(
self
.
delegate
&&
[
self
.
delegate
respondsToSelector
:
@selector
(
metalView
:
didFinishPlayingWithError
:
)])
{
[
self
.
delegate
metalView
:
self
didFinishPlayingWithError
:
error
];
...
...
@@ -137,6 +144,13 @@
return
;
}
self
.
state
=
BDAlphaPlayerPlayStatePlay
;
if
(
self
.
needPlayAudio
)
{
AVPlayerItem
*
playItem
=
[[
AVPlayerItem
alloc
]
initWithURL
:
url
];
self
.
audioPlayer
=
[
AVPlayer
playerWithPlayerItem
:
playItem
];
[
self
.
audioPlayer
play
];
}
__weak
__typeof
(
self
)
weakSelf
=
self
;
[
self
renderOutput
:
output
resourceModel
:
self
.
model
completion
:^
{
[
weakSelf
renderCompletion
];
...
...
@@ -170,6 +184,8 @@
-
(
void
)
destroyMTKView
{
[
self
.
audioPlayer
pause
];
self
.
audioPlayer
=
nil
;
self
.
mtkView
.
paused
=
YES
;
[
self
.
mtkView
removeFromSuperview
];
[
self
.
mtkView
releaseDrawables
];
...
...
DevelopmentPods/FUSBDAlphaPlayer/FUSBDAlphaPlayer/Classes/Model/BDAlphaPlayerMetalConfiguration.h
View file @
7458f44b
...
...
@@ -28,6 +28,8 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property
(
nonatomic
,
assign
)
CGRect
renderSuperViewFrame
;
@property
(
nonatomic
,
assign
)
BOOL
playAudio
;
+
(
instancetype
)
defaultConfiguration
;
@end
...
...
DevelopmentPods/FUSCommon/FUSCommon/Classes/Common/FUSGiftCenter/Animtions/FUSWEBPGiftAnimation.m
View file @
7458f44b
...
...
@@ -14,6 +14,9 @@
#import <YYKit/YYKit.h>
#import <FUSBDAlphaPlayer/BDAlphaPlayer.h>
#import "FUSCacheDataShare.h"
#import "FUSRouter.h"
// 读取WEBP图片最大重试次数
#define MAX_RETRY_TIME 3
...
...
@@ -100,6 +103,7 @@
configuration
.
directory
=
filePath
;
configuration
.
renderSuperViewFrame
=
UIView
.
fus_screenFrame
;
configuration
.
orientation
=
BDAlphaPlayerOrientationPortrait
;
configuration
.
playAudio
=
[
self
fus_needPlayAudio
];
[
self
.
playView
playWithMetalConfiguration
:
configuration
];
...
...
@@ -112,6 +116,15 @@
}
}
-
(
BOOL
)
fus_needPlayAudio
{
BOOL
localEnterRoomCarAudioSwitch
=
[
FUSCacheDataShare
shareStore
].
settingInitDataModel
.
localEnterRoomCarAudioSwitch
==
YES
;
BOOL
isPlayOnSpeaker
=
[[
FUSAudioHelper
shareInstance
]
isPlayOnSpeaker
];
return
(
localEnterRoomCarAudioSwitch
&&
(
!
isPlayOnSpeaker
));
}
-
(
void
)
fus_endGiftAnimation
{
[
super
fus_endGiftAnimation
];
...
...
DevelopmentPods/FUSCommon/FUSCommon/Classes/Common/FUSGiftCenter/DataCenter/Model/FUSMotorDataModel.m
View file @
7458f44b
...
...
@@ -15,19 +15,10 @@
-
(
void
)
fus_playMotorAudioIfNeeded
{
if
([
self
fus_needPlayAudio
])
{
NSString
*
filePath
=
@""
;
if
([
NSString
isNullWithString
:
self
.
mp4Res
])
{
if
([[
FUSGiftDataCenter
sharedCenter
]
fus_checkGiftResourceExitWithURL
:
self
.
audioresource
resourceMD5
:
nil
])
{
filePath
=
[
FUSConfig
.
sharedInstanced
.
pathConfigs
downloadResourcePath
:
self
.
audioresource
pathMd5
:
nil
];
}
}
else
{
filePath
=
[
FUSConfig
.
sharedInstanced
.
pathConfigs
downloadResourcePath
:
self
.
mp4Res
pathMd5
:
self
.
mp4Md5
];
}
if
([
NSString
isNullWithString
:
filePath
]
==
NO
)
{
if
([[
FUSGiftDataCenter
sharedCenter
]
fus_checkGiftResourceExitWithURL
:
self
.
audioresource
resourceMD5
:
nil
])
{
NSString
*
filePath
=
[
FUSConfig
.
sharedInstanced
.
pathConfigs
downloadResourcePath
:
self
.
audioresource
pathMd5
:
nil
];
[[
FUSAudioHelper
shareInstance
]
stop
];
[[
FUSAudioHelper
shareInstance
]
playWithFilePath
:[
NSURL
URLWithString
:
filePath
]
progress
:
^
(
NSTimeInterval
currentTime
)
{
...
...
@@ -41,6 +32,10 @@
-
(
BOOL
)
fus_needPlayAudio
{
BOOL
audioresourceIsNull
=
[
NSString
isNullWithString
:
self
.
audioresource
];
if
(
audioresourceIsNull
==
NO
&&
[
NSString
isNullWithString
:
self
.
mp4Res
]
==
NO
)
{
audioresourceIsNull
=
YES
;
}
BOOL
localEnterRoomCarAudioSwitch
=
[
FUSCacheDataShare
shareStore
].
settingInitDataModel
.
localEnterRoomCarAudioSwitch
==
YES
;
BOOL
myselfIsOnMic
=
[
FUSRouter
liveRouter
].
selfOnMicList
;
BOOL
isNotAnchor
=
!
[[
FUSRouter
liveRouter
]
isAnchor
];
...
...
FuSiLive.xcodeproj/project.pbxproj
View file @
7458f44b
...
...
@@ -102,7 +102,7 @@
/* End PBXFileReference section */
/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
00E501FF2E0543A800579DB0
/*
Exceptions for "NotificationService" folder in "NotificationService" targ
et */
=
{
00E501FF2E0543A800579DB0
/*
PBXFileSystemSynchronizedBuildFileExceptionS
et */
=
{
isa
=
PBXFileSystemSynchronizedBuildFileExceptionSet
;
membershipExceptions
=
(
"NotificationService-Info.plist"
,
...
...
@@ -112,18 +112,7 @@
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
/* Begin PBXFileSystemSynchronizedRootGroup section */
00E501F42E0543A800579DB0
/* NotificationService */
=
{
isa
=
PBXFileSystemSynchronizedRootGroup
;
exceptions
=
(
00E501FF2E0543A800579DB0
/* Exceptions for "NotificationService" folder in "NotificationService" target */
,
);
explicitFileTypes
=
{
};
explicitFolders
=
(
);
path
=
NotificationService
;
sourceTree
=
"<group>"
;
};
00E501F42E0543A800579DB0
/* NotificationService */
=
{
isa
=
PBXFileSystemSynchronizedRootGroup
;
exceptions
=
(
00E501FF2E0543A800579DB0
/* PBXFileSystemSynchronizedBuildFileExceptionSet */
,
);
explicitFileTypes
=
{};
explicitFolders
=
();
path
=
NotificationService
;
sourceTree
=
"<group>"
;
};
/* End PBXFileSystemSynchronizedRootGroup section */
/* Begin PBXFrameworksBuildPhase section */
...
...
@@ -675,7 +664,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
CODE_SIGN_ENTITLEMENTS
=
FuSiLive/FuSiLive.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
2025062
30003
;
CURRENT_PROJECT_VERSION
=
2025062
60001
;
DEFINES_MODULE
=
YES
;
DEVELOPMENT_TEAM
=
6GG26BHUMC
;
ENABLE_ON_DEMAND_RESOURCES
=
NO
;
...
...
@@ -943,7 +932,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
CODE_SIGN_ENTITLEMENTS
=
FuSiLive/FuSiLive.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
2025062
30003
;
CURRENT_PROJECT_VERSION
=
2025062
60001
;
DEFINES_MODULE
=
YES
;
DEVELOPMENT_TEAM
=
6GG26BHUMC
;
ENABLE_ON_DEMAND_RESOURCES
=
NO
;
...
...
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/Other/FUSCarEnterView.m
View file @
7458f44b
...
...
@@ -210,6 +210,7 @@
CGRect
renderSuperViewFrame
=
weakSelf
.
playView
.
frame
;
configuration
.
renderSuperViewFrame
=
renderSuperViewFrame
;
configuration
.
orientation
=
BDAlphaPlayerOrientationPortrait
;
configuration
.
playAudio
=
[
weakSelf
.
motorModel
fus_needPlayAudio
];
[
weakSelf
.
playView
playWithMetalConfiguration
:
configuration
];
...
...
@@ -239,8 +240,9 @@
CGRect
keyboardFrame
=
[
FUSKeyboardShowHelper
sharedInstance
].
keyboardFrame
;
[
self
fus_restContentYWithKeyboardFrame
:
keyboardFrame
withAnimate
:
NO
];
}
[
self
.
motorModel
fus_playMotorAudioIfNeeded
];
if
([
NSString
isNullWithString
:
self
.
motorModel
.
mp4Res
])
{
[
self
.
motorModel
fus_playMotorAudioIfNeeded
];
}
_carImageView
.
alpha
=
0
;
...
...
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