Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JM_4-2
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
JM_4-2
Commits
caae671e
Commit
caae671e
authored
Aug 25, 2021
by
limingzhe
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://vcs.ireadabc.com/template/JM_4-2
parents
4676b2be
73fa2b2a
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14263 additions
and
6 deletions
+14263
-6
package-lock.json
package-lock.json
+14240
-0
play.component.ts
src/app/play/play.component.ts
+23
-6
No files found.
package-lock.json
0 → 100644
View file @
caae671e
This diff is collapsed.
Click to expand it.
src/app/play/play.component.ts
View file @
caae671e
...
@@ -656,24 +656,41 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -656,24 +656,41 @@ export class PlayComponent implements OnInit, OnDestroy {
this
.
soundStyleMarginL
=
-
this
.
curSoundIconIndex
*
100
+
'
%
'
this
.
soundStyleMarginL
=
-
this
.
curSoundIconIndex
*
100
+
'
%
'
}
}
currentAudio
=
null
;
currentAudioCallback
=
null
;
playSentenceAudio
()
{
playSentenceAudio
()
{
const
mp3Url
=
this
.
curSentenceData
.
audio_url
const
mp3Url
=
this
.
curSentenceData
.
audio_url
if
(
!
mp3Url
)
{
if
(
!
mp3Url
)
{
return
;
return
;
}
}
if
(
this
.
currentAudio
)
{
this
.
currentAudio
.
pause
();
if
(
this
.
currentAudioCallback
)
{
this
.
currentAudioCallback
();
this
.
currentAudioCallback
=
null
;
}
}
const
mp3
=
new
Audio
(
mp3Url
);
const
mp3
=
new
Audio
(
mp3Url
);
mp3
.
play
();
//播放 mp3这个音频对象
mp3
.
play
();
//播放 mp3这个音频对象
mp3
.
addEventListener
(
"
ended
"
,
()
=>
{
this
.
currentAudio
=
mp3
;
this
.
currentAudioCallback
=
()
=>
{
this
.
stopSoundAnim
();
this
.
stopSoundAnim
();
if
(
!
this
.
isCountDownStart
)
{
if
(
!
this
.
isCountDownStart
)
{
this
.
countDownStart
();
this
.
countDownStart
();
}
}
}
)
;
};
mp3
.
addEventListener
(
"
ended
"
,
()
=>
{
if
(
this
.
currentAudioCallback
)
{
this
.
currentAudioCallback
();
this
.
currentAudioCallback
=
null
;
}
});
this
.
showSoundAnim
();
this
.
showSoundAnim
();
}
}
playHtmlAudio
(
mp3Url
,
cb
=
null
)
{
playHtmlAudio
(
mp3Url
,
cb
=
null
)
{
...
...
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