Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dfzx_mb_07
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
dfzx_mb_07
Commits
1913c256
Commit
1913c256
authored
Oct 28, 2020
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 音频不播放的问题
parent
a2dff6e1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
58 deletions
+17
-58
play.component.ts
src/app/play/play.component.ts
+16
-57
defaultData.js
src/assets/play/default/formData/defaultData.js
+1
-1
No files found.
src/app/play/play.component.ts
View file @
1913c256
...
...
@@ -678,6 +678,13 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
m_frontCurtainArr
.
push
(
E
.
ref
)
}
userTriggerAudio
(
key
){
if
(
key
){
this
.
g_cartoon
.
playAudio
(
key
)
this
.
g_cartoon
.
pauseAudio
(
key
)
}
}
curtainContral
(
status
,
callback
?){
let
all
=
[
"
Curtain-A
"
,
"
Curtain-B
"
,
"
Curtain-C
"
,
"
Curtain-D
"
]
let
_this
=
this
...
...
@@ -708,6 +715,8 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
initStartButton
(){
let
element
=
this
.
g_cartoon
.
createCartoonElementImageFunc
(
"
start-button
"
,
"
btn_start
"
,
(
w
,
h
)
=>
{
return
{
...
...
@@ -723,6 +732,9 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
m_frontCurtainArr
.
push
(
element
.
ref
)
this
.
subscribeMapDownEvent
(
element
.
id
,
()
=>
{
this
.
userTriggerAudio
(
"
gusheng_kaitou
"
);
this
.
g_cartoon
.
playAudio
(
"
dianji
"
)
this
.
showJellyAnimation
(
element
.
id
,
()
=>
{
tweenChange
(
element
.
ref
,
{
x
:
this
.
g_canvasWidth
+
331
*
this
.
g_mapScale
},
0.5
)
...
...
@@ -767,10 +779,6 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
showJellyAnimation
(
element
.
id
,
()
=>
{
element
.
out
()
})
this
.
g_cartoon
.
playAudio
(
"
jiazigu_changgusheng
"
)
this
.
m_setTimeoutIDs
.
push
(
setTimeout
(()
=>
{
this
.
g_cartoon
.
playAudio
(
"
guzhang
"
)
},
1000
))
this
.
m_restartGameFlag
=
true
;
this
.
curtainContral
(
false
,
()
=>
{
this
.
g_cartoon
.
getCartoonElement
(
"
boy
"
).
reset
()
...
...
@@ -926,6 +934,10 @@ export class PlayComponent implements OnInit, OnDestroy {
element
.
isOpen
=
false
;
this
.
subscribeMapDownEvent
(
element
.
id
,
()
=>
{
this
.
userTriggerAudio
(
`gusheng_
${
index
+
1
}
`
);
this
.
userTriggerAudio
(
element
.
audio_url
);
if
(
!
this
.
m_startGame
||
element
.
isOpen
){
if
(
element
.
isOpen
){
this
.
g_cartoon
.
stopAllAudio
();
...
...
@@ -1036,59 +1048,6 @@ export class PlayComponent implements OnInit, OnDestroy {
}
// --------------------------------------------------
// -------------- Template function ---------------
// --------------------------------------------------
...
...
src/assets/play/default/formData/defaultData.js
View file @
1913c256
...
...
@@ -5,7 +5,7 @@ export default {
{
type
:
"
Text
"
,
text
:
"
Apple
"
,
audio_url
:
""
,
audio_url
:
"
assets/play/sound/dianji.mp3
"
,
image_url
:
""
}
],
...
...
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