Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hw_002
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
hw_002
Commits
647188cb
Commit
647188cb
authored
Dec 27, 2019
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix duration bug
parent
6ba386bc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
4 deletions
+49
-4
form.component.html
src/app/form/form.component.html
+22
-1
form.component.ts
src/app/form/form.component.ts
+7
-0
play.component.scss
src/app/play/play.component.scss
+1
-1
play.component.ts
src/app/play/play.component.ts
+19
-2
guide.mp4
src/assets/guide/guide.mp4
+0
-0
No files found.
src/app/form/form.component.html
View file @
647188cb
<div
class=
"courseware-container d-flex row"
#
videoContainer
>
<button
style=
"margin: 4vw; display: flex; align-items: center"
nz-button
nzType=
"primary"
nzGhost
(
click
)="
guideBtnClick
(
true
)"
>
<i
nz-icon
type=
"play-circle"
></i>
1分钟简易教程
</button>
<div
class=
"courseware-container d-flex row"
#
videoContainer
style=
"padding-left: 2vw; width: 90%"
>
<div
class=
"col-8"
>
<!--crossorigin="anonymous"-->
<video
class=
"courseware-video"
...
...
@@ -52,3 +62,14 @@
</div>
</div>
<div
*
ngIf=
"showGuideAudio"
style=
"position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-items: center; background: rgba(0,0,0,.7)"
(
click
)="
guideBtnClick
(
false
)"
>
<div
style=
"margin: auto;"
>
<video
style=
"width: 60vw; height: auto"
src=
"assets/guide/guide.mp4"
controls=
"controls"
>
您的浏览器不支持 audio 标签。
</video>
</div>
</div>
src/app/form/form.component.ts
View file @
647188cb
...
...
@@ -33,6 +33,8 @@ export class FormComponent implements OnInit, OnChanges {
KEY
=
'
hw_002
'
;
showGuideAudio
;
private
tooBigError
:
NzMessageDataFilled
=
null
;
...
...
@@ -222,5 +224,10 @@ export class FormComponent implements OnInit, OnChanges {
this
.
appRef
.
tick
();
},
1
);
}
guideBtnClick
(
value
)
{
this
.
showGuideAudio
=
value
;
}
}
src/app/play/play.component.scss
View file @
647188cb
...
...
@@ -26,7 +26,7 @@
.k-play-btn
{
position
:
absolute
;
//width: 12%;
top
:
80
%
;
top
:
75
%
;
left
:
88%
;
font-size
:
12vh
;
color
:
#444
;
...
...
src/app/play/play.component.ts
View file @
647188cb
import
{
AfterViewInit
,
ApplicationRef
,
Component
,
ElementRef
,
Input
,
OnDestroy
,
OnInit
,
ViewChild
}
from
'
@angular/core
'
;
import
{
AfterViewInit
,
ApplicationRef
,
ChangeDetectorRef
,
Component
,
ElementRef
,
Input
,
OnDestroy
,
OnInit
,
ViewChild
}
from
'
@angular/core
'
;
@
Component
({
selector
:
'
app-play
'
,
...
...
@@ -27,7 +37,8 @@ export class PlayComponent implements AfterViewInit, OnInit, OnDestroy {
// aaa;
constructor
(
private
appRef
:
ApplicationRef
)
{
constructor
(
private
appRef
:
ApplicationRef
,
public
changeDetectorRef
:
ChangeDetectorRef
)
{
}
ngOnInit
()
{
...
...
@@ -66,6 +77,8 @@ export class PlayComponent implements AfterViewInit, OnInit, OnDestroy {
window
[
'
air
'
].
hideAirClassLoading
(
this
.
KEY
,
this
.
data
);
this
.
refresh
();
},
this
.
KEY
);
...
...
@@ -140,6 +153,7 @@ export class PlayComponent implements AfterViewInit, OnInit, OnDestroy {
this
.
player
.
onloadedmetadata
=
()
=>
{
this
.
currentTime
=
0
;
this
.
duration
=
this
.
player
.
duration
;
};
this
.
player
.
onseeking
=
()
=>
{
this
.
player
.
pause
();
...
...
@@ -171,6 +185,9 @@ export class PlayComponent implements AfterViewInit, OnInit, OnDestroy {
const
player
=
event
.
target
;
this
.
currentTime
=
player
.
currentTime
;
this
.
progress
=
Math
.
floor
((
player
.
currentTime
/
player
.
duration
)
*
100
);
this
.
duration
=
this
.
player
.
duration
;
}
onBtnQuickSeek
(
delta
:
number
)
{
...
...
src/assets/guide/guide.mp4
0 → 100644
View file @
647188cb
File added
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