Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dfzx_mb_02
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_02
Commits
daf8bf4d
Commit
daf8bf4d
authored
Oct 22, 2020
by
Li Mingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 优化音频卡住
parent
786a04a9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
play.component.ts
src/app/play/play.component.ts
+12
-8
index.html
src/index.html
+4
-0
No files found.
src/app/play/play.component.ts
View file @
daf8bf4d
...
@@ -212,6 +212,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -212,6 +212,7 @@ export class PlayComponent implements OnInit, OnDestroy {
showPetalFlag
;
showPetalFlag
;
bg
;
bg
;
delayPicSoundShowTime
=
700
;
...
@@ -335,6 +336,9 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -335,6 +336,9 @@ export class PlayComponent implements OnInit, OnDestroy {
const
contentObj
=
this
.
data
.
contentObj
;
const
contentObj
=
this
.
data
.
contentObj
;
if
(
!
contentObj
)
{
return
;
}
if
(
!
contentObj
)
{
return
;
}
const
picArr
=
contentObj
.
picArr
;
console
.
log
(
'
this.data:
'
,
this
.
data
);
// const addAudio = (key) => {
// const addAudio = (key) => {
...
@@ -347,10 +351,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -347,10 +351,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// }
// }
// }
// }
//
//
// for (let i = 0; i < 4; i ++) {
// const key = i + '_audio_url';
// addAudio(key);
// }
//
//
// addAudio('audio_url');
// addAudio('audio_url');
//
//
...
@@ -366,13 +367,13 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -366,13 +367,13 @@ export class PlayComponent implements OnInit, OnDestroy {
audio
.
load
();
audio
.
load
();
this
.
audioObj
[
audioUrl
]
=
audio
;
this
.
audioObj
[
audioUrl
]
=
audio
;
}
}
};
};
const
arr
=
contentObj
.
picArr
;
const
arr
=
contentObj
.
picArr
;
if
(
arr
)
{
if
(
arr
)
{
console
.
log
(
'
arr:
'
,
arr
);
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
addUrlToAudioObj
(
arr
[
i
].
audio_url
);
addUrlToAudioObj
(
arr
[
i
].
audio_url
);
}
}
...
@@ -2046,7 +2047,6 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -2046,7 +2047,6 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
showPicSound
()
{
showPicSound
()
{
this
.
canTouch
=
false
;
this
.
canTouch
=
false
;
...
@@ -2067,13 +2067,17 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -2067,13 +2067,17 @@ export class PlayComponent implements OnInit, OnDestroy {
audio
.
onended
=
()
=>
{
audio
.
onended
=
()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
showPicSound
();
this
.
showPicSound
();
},
0.7
*
1000
);
},
this
.
delayPicSoundShowTime
);
};
};
audio
.
play
();
audio
.
play
();
this
.
answerIdIndex
++
;
}
else
{
this
.
showPicSound
();
}
}
this
.
answerIdIndex
++
;
}
}
...
...
src/index.html
View file @
daf8bf4d
...
@@ -9,6 +9,10 @@
...
@@ -9,6 +9,10 @@
<link
rel=
"icon"
type=
"image/x-icon"
href=
"favicon.ico"
>
<link
rel=
"icon"
type=
"image/x-icon"
href=
"favicon.ico"
>
<script
type=
"text/javascript"
src=
"http://teach.cdn.ireadabc.com/h5template/h5-static-lib/js/air.js"
></script>
<script
type=
"text/javascript"
src=
"http://teach.cdn.ireadabc.com/h5template/h5-static-lib/js/air.js"
></script>
<script
src=
"https://cdn.bootcss.com/vConsole/3.3.4/vconsole.min.js"
></script>
<script>
var
vConsole
=
new
VConsole
();
</script>
</head>
</head>
<body>
<body>
<app-root></app-root>
<app-root></app-root>
...
...
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