Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ydLife
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sweet Zhang
ydLife
Commits
b26ca851
Commit
b26ca851
authored
May 18, 2022
by
Sweet Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
视频播放接口对接
parent
a6cfaf59
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
25 deletions
+20
-25
src/app/common/video/video.component.ts
+19
-23
src/app/my/file-upload/file-upload.component.html
+1
-1
src/app/my/file-upload/file-upload.component.ts
+0
-1
No files found.
src/app/common/video/video.component.ts
View file @
b26ca851
...
@@ -14,9 +14,10 @@ export class VideoComponent implements OnInit, AfterViewInit, OnDestroy {
...
@@ -14,9 +14,10 @@ export class VideoComponent implements OnInit, AfterViewInit, OnDestroy {
permissions
:
any
;
permissions
:
any
;
lifeCustomerInfo
:
any
;
lifeCustomerInfo
:
any
;
timer
:
any
;
timer
:
any
;
timer2
:
any
;
timer2
:
any
;
videoPlaybacks
:
Array
<
any
>
;
videoPlaybacks
:
Array
<
any
>
;
originTime
:
number
=
0
;
originTime
:
number
=
0
;
fileId
:
string
;
constructor
(
private
activatedRoute
:
ActivatedRoute
,
private
myService
:
MyService
)
{
}
constructor
(
private
activatedRoute
:
ActivatedRoute
,
private
myService
:
MyService
)
{
}
ngOnInit
()
{
ngOnInit
()
{
...
@@ -24,9 +25,17 @@ export class VideoComponent implements OnInit, AfterViewInit, OnDestroy {
...
@@ -24,9 +25,17 @@ export class VideoComponent implements OnInit, AfterViewInit, OnDestroy {
this
.
permissions
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'permissions'
));
this
.
permissions
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'permissions'
));
this
.
pdfPath
=
this
.
activatedRoute
.
snapshot
.
queryParams
[
'path'
];
this
.
pdfPath
=
this
.
activatedRoute
.
snapshot
.
queryParams
[
'path'
];
this
.
lifeCustomerInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
'lifeCustomerInfo'
));
this
.
lifeCustomerInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
'lifeCustomerInfo'
));
this
.
fileId
=
this
.
activatedRoute
.
snapshot
.
params
[
'fileId'
]
this
.
timer
=
setInterval
(()
=>
{
this
.
timer
=
setInterval
(()
=>
{
this
.
saveVideoPlayback
()
this
.
saveVideoPlayback
()
;
},
1000
*
20
)
},
1000
*
20
)
this
.
timer2
=
setInterval
(()
=>
{
if
(
this
.
video
.
nativeElement
.
currentTime
-
this
.
originTime
>
1
)
{
this
.
video
.
nativeElement
.
currentTime
=
this
.
originTime
;
// this.video.nativeElement.pause();
}
this
.
originTime
=
this
.
video
.
nativeElement
.
currentTime
;
},
500
)
this
.
queryVideoPlayback
()
this
.
queryVideoPlayback
()
}
}
...
@@ -35,32 +44,20 @@ export class VideoComponent implements OnInit, AfterViewInit, OnDestroy {
...
@@ -35,32 +44,20 @@ export class VideoComponent implements OnInit, AfterViewInit, OnDestroy {
console
.
log
(
'暂停播放'
)
console
.
log
(
'暂停播放'
)
this
.
saveVideoPlayback
();
this
.
saveVideoPlayback
();
});
});
// 禁止拖动进度条
this
.
timer2
=
setInterval
(()
=>
{
const
currentTime
=
this
.
video
.
nativeElement
.
currentTime
;
const
originTime
=
Number
(
sessionStorage
.
getItem
(
'curTime'
))
;
if
(
currentTime
-
originTime
>
1
)
{
this
.
video
.
nativeElement
.
currentTime
=
sessionStorage
.
getItem
(
'curTime'
)
this
.
video
.
nativeElement
.
pause
();
sessionStorage
.
setItem
(
'curTime'
,
currentTime
)
}
},
500
)
// >>>>>>>>>>>>>禁止拖动进度条结束<<<<<<<<<<<<<<
const
attr
=
this
.
video
.
nativeElement
.
getAttribute
(
'controlslist'
)
if
(
this
.
permissions
.
isDownload
==
'2'
)
{
if
(
this
.
permissions
.
isDownload
==
'2'
)
{
this
.
video
.
nativeElement
.
setAttribute
(
'controlslist'
,
attr
+
' nodownload'
)
this
.
video
.
nativeElement
.
setAttribute
(
'controlslist'
,
this
.
video
.
nativeElement
.
getAttribute
(
'controlslist'
)
+
' nodownload'
)
}
else
{
}
else
{
this
.
video
.
nativeElement
.
setAttribute
(
'controlslist'
,
attr
)
this
.
video
.
nativeElement
.
setAttribute
(
'controlslist'
,
this
.
video
.
nativeElement
.
getAttribute
(
'controlslist'
)
)
}
}
if
(
this
.
permissions
.
isControlPlayback
==
'2'
)
{
if
(
this
.
permissions
.
isControlPlayback
==
'2'
)
{
this
.
video
.
nativeElement
.
setAttribute
(
'controlslist'
,
attr
+
' noplaybackrate'
)
this
.
video
.
nativeElement
.
setAttribute
(
'controlslist'
,
this
.
video
.
nativeElement
.
getAttribute
(
'controlslist'
)
+
' noplaybackrate'
)
}
else
{
}
else
{
this
.
video
.
nativeElement
.
setAttribute
(
'controlslist'
,
attr
)
this
.
video
.
nativeElement
.
setAttribute
(
'controlslist'
,
this
.
video
.
nativeElement
.
getAttribute
(
'controlslist'
)
)
}
}
}
}
ngOnDestroy
():
void
{
ngOnDestroy
():
void
{
clearInterval
(
this
.
timer
)
clearInterval
(
this
.
timer
)
;
clearInterval
(
this
.
timer2
)
clearInterval
(
this
.
timer2
)
;
this
.
saveVideoPlayback
();
this
.
saveVideoPlayback
();
}
}
menuPrevent
()
{
menuPrevent
()
{
...
@@ -72,12 +69,11 @@ export class VideoComponent implements OnInit, AfterViewInit, OnDestroy {
...
@@ -72,12 +69,11 @@ export class VideoComponent implements OnInit, AfterViewInit, OnDestroy {
id
:
''
,
id
:
''
,
customerId
:
this
.
lifeCustomerInfo
.
customerId
,
customerId
:
this
.
lifeCustomerInfo
.
customerId
,
practitionerId
:
this
.
lifeCustomerInfo
.
practitionerId
,
practitionerId
:
this
.
lifeCustomerInfo
.
practitionerId
,
fileId
:
''
,
fileId
:
this
.
fileId
,
totalTime
:
this
.
video
.
nativeElement
.
duration
,
totalTime
:
this
.
video
.
nativeElement
.
duration
,
viewTime
:
this
.
video
.
nativeElement
.
currentTime
,
viewTime
:
this
.
video
.
nativeElement
.
currentTime
,
playbackStatus
:
this
.
video
.
nativeElement
.
currentTime
>=
this
.
video
.
nativeElement
.
duration
?
2
:
1
,
playbackStatus
:
this
.
video
.
nativeElement
.
currentTime
>=
this
.
video
.
nativeElement
.
duration
?
2
:
1
,
}
}
sessionStorage
.
setItem
(
'curTime'
,
this
.
video
.
nativeElement
.
currentTime
);
this
.
myService
.
saveVideoPlayback
(
param
).
subscribe
(
res
=>
{
this
.
myService
.
saveVideoPlayback
(
param
).
subscribe
(
res
=>
{
console
.
log
(
res
);
console
.
log
(
res
);
})
})
...
@@ -88,7 +84,7 @@ export class VideoComponent implements OnInit, AfterViewInit, OnDestroy {
...
@@ -88,7 +84,7 @@ export class VideoComponent implements OnInit, AfterViewInit, OnDestroy {
id
:
''
,
id
:
''
,
customerId
:
this
.
lifeCustomerInfo
.
customerId
,
customerId
:
this
.
lifeCustomerInfo
.
customerId
,
practitionerId
:
this
.
lifeCustomerInfo
.
practitionerId
,
practitionerId
:
this
.
lifeCustomerInfo
.
practitionerId
,
fileId
:
''
,
fileId
:
this
.
fileId
,
}
}
this
.
myService
.
queryVideoPlayback
(
param
).
subscribe
(
res
=>
{
this
.
myService
.
queryVideoPlayback
(
param
).
subscribe
(
res
=>
{
if
(
res
[
'success'
])
{
if
(
res
[
'success'
])
{
...
...
src/app/my/file-upload/file-upload.component.html
View file @
b26ca851
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
<i
class=
"iconfont icon-xiazai"
style=
"margin-right: 0;"
></i>
<i
class=
"iconfont icon-xiazai"
style=
"margin-right: 0;"
></i>
</div>
</div>
</a>
</a>
<a
href=
"javascript:;"
[
routerLink
]="['/
video
']"
*
ngIf=
"judgmentFile(fileUploadItem.filePath)"
(
click
)="
setVideoPath
(
fileUploadItem
)"
>
<a
href=
"javascript:;"
[
routerLink
]="['/
video
'
,{'
fileId
'
:fileUploadItem
.
fileId
}
]"
*
ngIf=
"judgmentFile(fileUploadItem.filePath)"
(
click
)="
setVideoPath
(
fileUploadItem
)"
>
<div
style=
"overflow-x: hidden; white-space: nowrap;text-overflow: ellipsis;"
>
<div
style=
"overflow-x: hidden; white-space: nowrap;text-overflow: ellipsis;"
>
<img
src=
"assets/images/videoIcon.png"
alt=
"视频"
*
ngIf=
"judgmentFile(fileUploadItem.filePath)"
style=
" width: 26px;
<img
src=
"assets/images/videoIcon.png"
alt=
"视频"
*
ngIf=
"judgmentFile(fileUploadItem.filePath)"
style=
" width: 26px;
margin-right: 6px;"
>
margin-right: 6px;"
>
...
...
src/app/my/file-upload/file-upload.component.ts
View file @
b26ca851
...
@@ -53,7 +53,6 @@ export class FileUploadComponent implements OnInit {
...
@@ -53,7 +53,6 @@ export class FileUploadComponent implements OnInit {
this
.
selectedCategoryId
=
'requirementanalys'
this
.
selectedCategoryId
=
'requirementanalys'
}
}
this
.
fileUpload
(
3
,
0
,
23
,
'yd_trainning_file_type'
,
this
.
selectedCategoryId
);
this
.
fileUpload
(
3
,
0
,
23
,
'yd_trainning_file_type'
,
this
.
selectedCategoryId
);
console
.
log
(
this
.
activatedRoute
.
snapshot
)
}
}
}
}
// 判断是不是视频文件
// 判断是不是视频文件
...
...
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