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
50945ed5
Commit
50945ed5
authored
Nov 08, 2022
by
kyle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
公司介绍视频播放不了问题修改
parent
fbf4928a
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
4 deletions
+39
-4
src/app/app.component.ts
+1
-0
src/app/common/video/video.component.html
+5
-2
src/app/common/video/video.component.ts
+31
-0
src/app/my/file-upload/file-upload.component.html
+1
-1
src/app/my/my-routing.module.ts
+1
-1
No files found.
src/app/app.component.ts
View file @
50945ed5
...
@@ -87,6 +87,7 @@ export class AppComponent implements OnInit, OnDestroy {
...
@@ -87,6 +87,7 @@ export class AppComponent implements OnInit, OnDestroy {
||
event
.
url
.
indexOf
(
'/inviter'
)
>=
0
||
event
.
url
.
indexOf
(
'/inviter'
)
>=
0
||
event
.
url
.
indexOf
(
'/register'
)
>=
0
||
event
.
url
.
indexOf
(
'/register'
)
>=
0
||
event
.
url
.
indexOf
(
'/invitees'
)
>=
0
||
event
.
url
.
indexOf
(
'/invitees'
)
>=
0
||
event
.
url
.
indexOf
(
'/video/'
)
>=
0
){
){
this
.
isShowIndexBtn
=
false
;
this
.
isShowIndexBtn
=
false
;
}
}
...
...
src/app/common/video/video.component.html
View file @
50945ed5
<iframe
[
src
]="
filePath
|
safeResourceUrl
"
frameborder=
"0"
width=
"100%"
height=
"100%"
style=
"min-height: 100vh;"
></iframe>
<iframe
[
src
]="
filePath
|
safeResourceUrl
"
frameborder=
"0"
width=
"100%"
height=
"100%"
style=
"min-height: 100vh;"
*
ngIf=
"!isVideo"
></iframe>
\ No newline at end of file
<video
[
src
]="
filePath
|
safeResourceUrl
"
frameborder=
"0"
width=
"100%"
height=
"100%"
*
ngIf=
"isVideo"
controls
></video>
\ No newline at end of file
src/app/common/video/video.component.ts
View file @
50945ed5
...
@@ -11,6 +11,7 @@ export class VideoComponent implements OnInit {
...
@@ -11,6 +11,7 @@ export class VideoComponent implements OnInit {
filePath
:
string
;
filePath
:
string
;
fileCategory
:
string
;
fileCategory
:
string
;
fileId
:
string
;
fileId
:
string
;
isVideo
:
boolean
;
constructor
(
private
activatedRoute
:
ActivatedRoute
,
private
myService
:
MyService
)
{
}
constructor
(
private
activatedRoute
:
ActivatedRoute
,
private
myService
:
MyService
)
{
}
ngOnInit
()
{
ngOnInit
()
{
...
@@ -25,11 +26,41 @@ export class VideoComponent implements OnInit {
...
@@ -25,11 +26,41 @@ export class VideoComponent implements OnInit {
this
.
myService
.
filePath
(
'3'
,
'0'
,
fileCategory
,
'yd_trainning_file_type'
,
null
,
null
,
status
,
fileId
).
subscribe
(
res
=>
{
this
.
myService
.
filePath
(
'3'
,
'0'
,
fileCategory
,
'yd_trainning_file_type'
,
null
,
null
,
status
,
fileId
).
subscribe
(
res
=>
{
if
(
res
[
'success'
]){
if
(
res
[
'success'
]){
const
fileUploadItem
=
res
[
'data'
][
'fileUploadItemList'
][
0
];
const
fileUploadItem
=
res
[
'data'
][
'fileUploadItemList'
][
0
];
this
.
isVideo
=
this
.
judgmentFile
(
fileUploadItem
.
filePath
,
'video'
);
if
(
this
.
isVideo
){
this
.
filePath
=
fileUploadItem
.
filePath
;
}
else
{
this
.
filePath
=
`assets/pdfjs/web/viewer.html?file=
${
fileUploadItem
.
filePath
}
&isneeddownload=
${
fileUploadItem
.
isDownload
==
'1'
?
'true'
:
'false'
}
`
this
.
filePath
=
`assets/pdfjs/web/viewer.html?file=
${
fileUploadItem
.
filePath
}
&isneeddownload=
${
fileUploadItem
.
isDownload
==
'1'
?
'true'
:
'false'
}
`
}
}
}
})
})
}
}
// 判断是不是视频文件
judgmentFile
(
picUrl
,
type
=
'video'
)
{
let
filename
=
picUrl
;
//文件路径地址
let
index1
=
filename
.
lastIndexOf
(
"."
);
let
index2
=
filename
.
length
;
let
postf
=
filename
.
substring
(
index1
,
index2
).
toLowerCase
();
//获取文bai件后缀名duzhi
if
(
type
===
'video'
){
//判断文件后缀名是否等于视频文件的后缀名
if
(
postf
===
".avi"
||
postf
===
".mp4"
||
postf
===
".rmvb"
||
postf
===
".mov"
)
{
return
true
}
else
{
return
false
}
}
else
if
(
type
===
'pdf'
){
//判断文件后缀名是否等于pdf
if
(
postf
===
".pdf"
)
{
return
true
}
else
{
return
false
}
}
}
menuPrevent
()
{
menuPrevent
()
{
return
false
;
return
false
;
}
}
...
...
src/app/my/file-upload/file-upload.component.html
View file @
50945ed5
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
<i
class=
"iconfont"
style=
"margin-right: 0;"
[
ngClass
]="
fileUploadItem
.
isDownload=
='1'
?
'
icon-xiazai
'
:
'
icon-xianshi
'"
></i>
<i
class=
"iconfont"
style=
"margin-right: 0;"
[
ngClass
]="
fileUploadItem
.
isDownload=
='1'
?
'
icon-xiazai
'
:
'
icon-xianshi
'"
></i>
</div>
</div>
</a>
</a>
<a
href=
"javascript:;"
[
routerLink
]="['/
video
',
{'
fileId
'
:fileUploadItem
.
fileId
}
]"
*
ngIf=
"judgmentFile(fileUploadItem.filePath)"
(
click
)="
setVideoPath
(
fileUploadItem
)"
>
<a
href=
"javascript:;"
[
routerLink
]="['/
video
',
fileUploadItem
.
fileId
,
fileUploadItem
.
fileCategory
]"
*
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/my-routing.module.ts
View file @
50945ed5
...
@@ -182,7 +182,7 @@ const myRoutes: Routes = [
...
@@ -182,7 +182,7 @@ const myRoutes: Routes = [
{
path
:
'integration'
,
component
:
IntegrationComponent
,
canActivate
:[
AuthGuard
],
data
:[{
title
:
'我的积分'
}]},
{
path
:
'integration'
,
component
:
IntegrationComponent
,
canActivate
:[
AuthGuard
],
data
:[{
title
:
'我的积分'
}]},
{
path
:
'integration_detail'
,
component
:
IntegrationDetailComponent
,
canActivate
:[
AuthGuard
],
data
:[{
title
:
'积分明细'
}]},
{
path
:
'integration_detail'
,
component
:
IntegrationDetailComponent
,
canActivate
:[
AuthGuard
],
data
:[{
title
:
'积分明细'
}]},
{
path
:
'integration_rule'
,
component
:
IntegrationRuleComponent
,
canActivate
:[
AuthGuard
],
data
:[{
title
:
'积分规则'
}]},
{
path
:
'integration_rule'
,
component
:
IntegrationRuleComponent
,
canActivate
:[
AuthGuard
],
data
:[{
title
:
'积分规则'
}]},
{
path
:
'video'
,
component
:
VideoComponent
,
canActivate
:[
AuthGuard
],
data
:[{
title
:
'视频播放'
}]},
{
path
:
'video
/:fileId/:fileCategory
'
,
component
:
VideoComponent
,
canActivate
:[
AuthGuard
],
data
:[{
title
:
'视频播放'
}]},
{
path
:
'pdfView/:fileId/:fileCategory'
,
component
:
VideoComponent
,
canActivate
:[
AuthGuard
],
data
:[{
title
:
'PDF查看'
}]},
{
path
:
'pdfView/:fileId/:fileCategory'
,
component
:
VideoComponent
,
canActivate
:[
AuthGuard
],
data
:[{
title
:
'PDF查看'
}]},
{
path
:
'newsDetail/:id'
,
component
:
NewsDetailComponent
,
canActivate
:[
AuthGuard
],
data
:[{
title
:
'消息详情'
}]},
{
path
:
'newsDetail/:id'
,
component
:
NewsDetailComponent
,
canActivate
:[
AuthGuard
],
data
:[{
title
:
'消息详情'
}]},
{
path
:
'moreFeatures'
,
component
:
MoreFeaturesComponent
,
canActivate
:[
AuthGuard
],
data
:[{
title
:
'全部工具'
}]},
{
path
:
'moreFeatures'
,
component
:
MoreFeaturesComponent
,
canActivate
:[
AuthGuard
],
data
:[{
title
:
'全部工具'
}]},
...
...
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