Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jj_video_practice
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
jj_video_practice
Commits
41637290
Commit
41637290
authored
Dec 24, 2025
by
kingweight
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新url后缀
parent
14b7c953
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
form.component.ts
src/app/form/form.component.ts
+5
-5
No files found.
src/app/form/form.component.ts
View file @
41637290
...
@@ -176,7 +176,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
...
@@ -176,7 +176,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
this
.
currentFragmentQues
=
ques
;
this
.
currentFragmentQues
=
ques
;
this
.
currentFragmentIndex
=
i
;
this
.
currentFragmentIndex
=
i
;
this
.
fragmentVideoUrl
=
this
.
item
.
video_url
||
''
;
this
.
fragmentVideoUrl
=
this
.
item
.
video_url
||
''
;
const
videoUrl
=
this
.
item
.
video_url
?
this
.
item
.
video_url
.
replace
(
'
.mp4
'
,
'
_h.mp4
'
)
:
''
;
const
videoUrl
=
this
.
fragmentVideoUrl
;
this
.
fragmentVideoCurrentTime
=
ques
.
time
||
0
;
this
.
fragmentVideoCurrentTime
=
ques
.
time
||
0
;
this
.
fragmentSelectedTime
=
ques
.
time
||
0
;
this
.
fragmentSelectedTime
=
ques
.
time
||
0
;
this
.
videoThumbnails
=
[];
this
.
videoThumbnails
=
[];
...
@@ -416,7 +416,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
...
@@ -416,7 +416,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
}
}
// 检查缓存
// 检查缓存
const
videoUrl
=
this
.
item
.
video_url
?
this
.
item
.
video_url
.
replace
(
'
.mp4
'
,
'
_h.mp4
'
)
:
''
;
const
videoUrl
=
this
.
fragmentVideoUrl
;
const
cachedData
=
this
.
thumbnailCache
.
get
(
videoUrl
);
const
cachedData
=
this
.
thumbnailCache
.
get
(
videoUrl
);
// 视频元数据加载完成后,如果缓存不存在则生成缩略图
// 视频元数据加载完成后,如果缓存不存在则生成缩略图
...
@@ -524,7 +524,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
...
@@ -524,7 +524,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
onVideoIsAccessibleInCDN
(
url
:
string
)
{
onVideoIsAccessibleInCDN
(
url
:
string
)
{
console
.
log
(
'
视频已上传到CDN:
'
,
url
);
console
.
log
(
'
视频已上传到CDN:
'
,
url
);
this
.
fragmentVideoUrl
=
url
;
this
.
fragmentVideoUrl
=
url
.
replace
(
"
_h.mp4
"
,
"
.mp4
"
).
replace
(
"
.mp4
"
,
"
_l.mp4
"
)
;
this
.
changeDetectorRef
.
detectChanges
();
this
.
changeDetectorRef
.
detectChanges
();
}
}
...
@@ -555,7 +555,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
...
@@ -555,7 +555,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
}
}
// 检查缓存
// 检查缓存
const
videoUrl
=
this
.
item
.
video_url
?
this
.
item
.
video_url
.
replace
(
'
.mp4
'
,
'
_h.mp4
'
)
:
''
;
const
videoUrl
=
this
.
fragmentVideoUrl
;
const
cachedData
=
this
.
thumbnailCache
.
get
(
videoUrl
);
const
cachedData
=
this
.
thumbnailCache
.
get
(
videoUrl
);
if
(
cachedData
&&
cachedData
.
thumbnails
.
length
>
0
)
{
if
(
cachedData
&&
cachedData
.
thumbnails
.
length
>
0
)
{
console
.
log
(
'
使用缓存的缩略图,跳过生成
'
);
console
.
log
(
'
使用缓存的缩略图,跳过生成
'
);
...
@@ -651,7 +651,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
...
@@ -651,7 +651,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
// 将生成的缩略图存入缓存
// 将生成的缩略图存入缓存
if
(
this
.
videoThumbnails
.
length
>
0
)
{
if
(
this
.
videoThumbnails
.
length
>
0
)
{
const
videoUrl
=
this
.
item
.
video_url
?
this
.
item
.
video_url
.
replace
(
'
.mp4
'
,
'
_h.mp4
'
)
:
''
;
const
videoUrl
=
this
.
fragmentVideoUrl
;
const
cacheData
=
{
const
cacheData
=
{
thumbnails
:
[...
this
.
videoThumbnails
],
// 创建副本避免引用问题
thumbnails
:
[...
this
.
videoThumbnails
],
// 创建副本避免引用问题
duration
:
this
.
fragmentVideoDuration
,
duration
:
this
.
fragmentVideoDuration
,
...
...
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