Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pu09
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
pu09
Commits
948e5ee0
Commit
948e5ee0
authored
Apr 07, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 不上传音频的时候,不显示播放器
parent
e942b39d
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13142 additions
and
13 deletions
+13142
-13
angular.json
angular.json
+5
-2
package-lock.json
package-lock.json
+13111
-0
form.component.ts
src/app/form/form.component.ts
+2
-0
play.component.ts
src/app/play/play.component.ts
+24
-11
No files found.
angular.json
View file @
948e5ee0
...
...
@@ -128,5 +128,8 @@
}
}
},
"defaultProject"
:
"ng-template-generator"
}
"defaultProject"
:
"ng-template-generator"
,
"cli"
:
{
"analytics"
:
false
}
}
\ No newline at end of file
package-lock.json
0 → 100644
View file @
948e5ee0
This diff is collapsed.
Click to expand it.
src/app/form/form.component.ts
View file @
948e5ee0
...
...
@@ -88,6 +88,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
onAudioUploadSuccess
(
e
,
key
)
{
this
.
item
[
key
]
=
e
.
url
;
// this.item[key] = '';
this
.
save
();
}
...
...
@@ -98,6 +99,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
*/
save
()
{
(
<
any
>
window
).
courseware
.
setData
(
this
.
item
,
null
,
this
.
saveKey
);
console
.
log
(
'
this.item =
'
+
JSON
.
stringify
(
this
.
item
));
this
.
refresh
();
}
...
...
src/app/play/play.component.ts
View file @
948e5ee0
...
...
@@ -448,9 +448,9 @@ export class PlayComponent implements OnInit, OnDestroy {
];
}
if
(
!
this
.
data
.
audio_url
)
{
this
.
data
.
audio_url
=
'
assets/play/default/audio.mp3
'
;
}
//
if (!this.data.audio_url) {
//
this.data.audio_url = 'assets/play/default/audio.mp3';
//
}
}
...
...
@@ -467,7 +467,9 @@ export class PlayComponent implements OnInit, OnDestroy {
initAudio
()
{
// 音频资源
this
.
addUrlToAudioObj
(
this
.
data
.
audio_url
);
if
(
this
.
data
.
audio_url
)
{
this
.
addUrlToAudioObj
(
this
.
data
.
audio_url
);
}
...
...
@@ -585,6 +587,7 @@ export class PlayComponent implements OnInit, OnDestroy {
mapDown
(
event
)
{
if
(
!
this
.
canTouch
)
{
return
;
}
...
...
@@ -600,15 +603,19 @@ export class PlayComponent implements OnInit, OnDestroy {
}
if
(
this
.
checkClickTarget
(
this
.
progressBarBg
))
{
this
.
isClickedProgress
=
true
;
this
.
touchDownProgressBar
(
this
.
progressBarBg
);
return
;
if
(
this
.
progressBarBg
){
if
(
this
.
checkClickTarget
(
this
.
progressBarBg
))
{
this
.
isClickedProgress
=
true
;
this
.
touchDownProgressBar
(
this
.
progressBarBg
);
return
;
}
}
if
(
this
.
checkClickTarget
(
this
.
curAudio
.
playBtn
))
{
this
.
touchDownAudioBtn
(
this
.
curAudio
);
return
;
if
(
this
.
curAudio
)
{
if
(
this
.
checkClickTarget
(
this
.
curAudio
.
playBtn
))
{
this
.
touchDownAudioBtn
(
this
.
curAudio
);
return
;
}
}
this
.
sentences
.
forEach
((
sentence
)
=>
{
...
...
@@ -724,6 +731,9 @@ export class PlayComponent implements OnInit, OnDestroy {
}
private
initAudioPlayer
()
{
if
(
!
this
.
data
.
audio_url
)
{
return
;
}
this
.
curAudio
=
this
.
audioObj
[
this
.
data
.
audio_url
];
this
.
curAudio
.
onended
=
()
=>
{
this
.
setAudioState
(
this
.
curAudio
,
false
);
...
...
@@ -864,6 +874,9 @@ export class PlayComponent implements OnInit, OnDestroy {
}
private
updateTime
()
{
if
(
!
this
.
curAudio
)
{
return
;
}
if
(
!
this
.
isClickedProgress
)
{
const
progress
=
this
.
curAudio
.
currentTime
/
this
.
curAudio
.
duration
;
this
.
setAudioProgress
(
this
.
progressBarBg
,
progress
);
...
...
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