Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
hello_taobao
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
wildfirecode13
hello_taobao
Commits
47a9020c
Commit
47a9020c
authored
Sep 21, 2020
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
fe96b89d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
playBgMusic.js
dist/utils/playBgMusic.js
+6
-3
No files found.
dist/utils/playBgMusic.js
View file @
47a9020c
...
...
@@ -22,6 +22,7 @@ class AudioModel {
}
};
const
createAudio
=
opts
=>
{
console
.
log
(
'createAudio'
)
const
audioInstance
=
new
AudioModel
(
opts
)
return
audioInstance
;
};
...
...
@@ -30,8 +31,9 @@ let bgs = {
export
const
playBgMusic
=
(
isOn
,
src
)
=>
{
//待测试
for
(
let
k
in
bgs
)
{
if
(
bgs
[
k
].
isOn
)
{
bgs
[
k
].
pause
();
if
(
bgs
[
k
]
&&
bgs
[
k
].
isOn
)
{
bgs
[
k
].
destroy
();
bgs
[
k
]
=
null
;
}
// bgs[k].isOn = false; /// TODO 自己记一个开关,因为淘宝的玩意stop之后虽然听不到,但还是在播放,会触发loop播放和onEnded事件
}
...
...
@@ -78,7 +80,8 @@ export const playBgMusic = (isOn, src) => {//待测试
}
else
{
if
(
bgs
[
key
])
{
// bgs[key].pause(); /// pause ,不能用
bgs
[
key
].
pause
();
bgs
[
key
].
destroy
();
bgs
[
k
]
=
null
;
// bgs[key].isOn = false; /// TODO 自己记一个开关,因为淘宝的玩意stop之后虽然听不到,但还是在播放,会触发loop播放和onEnded事件
}
}
...
...
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