Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
3dc76668
Commit
3dc76668
authored
May 31, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 解决静音模式下播放视频无声音问题
parent
3cdd4604
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
AppDelegate.swift
galaxy/galaxy/AppDelegate.swift
+14
-0
YHUserInfoHeaderView.swift
...axy/Classes/Modules/Mine(我的)/V/YHUserInfoHeaderView.swift
+3
-3
No files found.
galaxy/galaxy/AppDelegate.swift
View file @
3dc76668
...
...
@@ -18,6 +18,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, WXApiDelegate {
var
window
:
UIWindow
?
func
application
(
_
application
:
UIApplication
,
didFinishLaunchingWithOptions
launchOptions
:
[
UIApplication
.
LaunchOptionsKey
:
Any
]?)
->
Bool
{
setupAudionConfig
()
//初始化 神策sdk
YHAnalytics
.
analyticsStart
(
launchOptions
:
launchOptions
)
...
...
@@ -157,6 +159,18 @@ extension AppDelegate {
player
?
.
pause
()
}
}
private
func
setupAudionConfig
()
{
// 确保 AVAudioSession 被正确配置,以便在静音模式下也能正常播放音频
do
{
try
AVAudioSession
.
sharedInstance
()
.
setCategory
(
AVAudioSession
.
Category
.
playback
)
try
AVAudioSession
.
sharedInstance
()
.
setActive
(
true
)
}
catch
let
error
as
NSError
{
print
(
"error:
\(
error
.
localizedDescription
)
"
)
}
}
}
galaxy/galaxy/Classes/Modules/Mine(我的)/V/YHUserInfoHeaderView.swift
View file @
3dc76668
...
...
@@ -57,7 +57,7 @@ class YHUserInfoHeaderView: UIView {
private
lazy
var
likeLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
text
=
"点赞 0"
.
local
label
.
textColor
=
UIColor
(
hex
:
0x
949DB
5
)
label
.
textColor
=
UIColor
(
hex
:
0x
121A26
,
transparency
:
0.
5
)
label
.
textAlignment
=
NSTextAlignment
.
left
label
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
13
)
label
.
isUserInteractionEnabled
=
true
...
...
@@ -70,7 +70,7 @@ class YHUserInfoHeaderView: UIView {
private
lazy
var
collectLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
text
=
"收藏 0"
.
local
label
.
textColor
=
UIColor
(
hex
:
0x
949DB
5
)
label
.
textColor
=
UIColor
(
hex
:
0x
121A26
,
transparency
:
0.
5
)
label
.
textAlignment
=
NSTextAlignment
.
left
label
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
13
)
label
.
isUserInteractionEnabled
=
true
...
...
@@ -83,7 +83,7 @@ class YHUserInfoHeaderView: UIView {
private
lazy
var
scanLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
text
=
"最近浏览 0"
.
local
label
.
textColor
=
UIColor
(
hex
:
0x
949DB
5
)
label
.
textColor
=
UIColor
(
hex
:
0x
121A26
,
transparency
:
0.
5
)
label
.
textAlignment
=
NSTextAlignment
.
left
label
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
13
)
label
.
isUserInteractionEnabled
=
true
...
...
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