Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fc-minigame
Project
Project
Details
Activity
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
陈冲
fc-minigame
Commits
3f06f803
Commit
3f06f803
authored
Jul 02, 2026
by
陈冲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 音乐更好
parent
1abd0126
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
music.ts
frontend-large/src/commons/music.ts
+9
-1
No files found.
frontend-large/src/commons/music.ts
View file @
3f06f803
...
@@ -40,9 +40,17 @@ function getBackgroundMusic(music: string, force: boolean = false) {
...
@@ -40,9 +40,17 @@ function getBackgroundMusic(music: string, force: boolean = false) {
stopAllMusic
();
stopAllMusic
();
}
}
backgroundMusic
=
new
Audio
(
music
)
backgroundMusic
=
new
Audio
(
music
)
backgroundMusic
.
loop
=
tru
e
backgroundMusic
.
loop
=
fals
e
backgroundMusic
.
preload
=
'auto'
backgroundMusic
.
preload
=
'auto'
backgroundMusic
.
volume
=
0.6
backgroundMusic
.
volume
=
0.6
backgroundMusic
.
addEventListener
(
'ended'
,
()
=>
{
if
(
!
backgroundMusic
||
!
backgroundMusic
.
src
.
endsWith
(
music
))
{
return
}
backgroundMusic
.
pause
()
backgroundMusic
.
currentTime
=
0
backgroundMusic
=
null
},
{
once
:
true
})
backgroundMusic
.
load
()
backgroundMusic
.
load
()
console
.
log
(
'[Music] 新背景音乐创建完成:'
,
backgroundMusic
.
src
)
console
.
log
(
'[Music] 新背景音乐创建完成:'
,
backgroundMusic
.
src
)
}
}
...
...
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