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
165c7f5f
Commit
165c7f5f
authored
Dec 25, 2025
by
kingweight
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复视频上传问题
parent
e153ebda
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
16 deletions
+12
-16
upload-video.component.ts
src/app/common/upload-video/upload-video.component.ts
+7
-9
form.component.html
src/app/form/form.component.html
+1
-1
form.component.ts
src/app/form/form.component.ts
+4
-6
No files found.
src/app/common/upload-video/upload-video.component.ts
View file @
165c7f5f
import
{
Component
,
ElementRef
,
EventEmitter
,
Input
,
OnChanges
,
OnDestroy
,
OnInit
,
Output
,
SecurityContext
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Component
,
ElementRef
,
EventEmitter
,
Input
,
OnChanges
,
OnDestroy
,
OnInit
,
Output
,
SecurityContext
,
SimpleChanges
,
ViewChild
}
from
'
@angular/core
'
;
import
{
HttpClientModule
}
from
'
@angular/common/http
'
;
import
{
HttpClient
,
HttpHeaders
,
HttpRequest
,
HttpEvent
,
HttpEventType
,
HttpResponse
,
HttpParams
}
from
"
@angular/common/http
"
;
...
...
@@ -119,7 +119,6 @@ export class UploadVideoComponent implements OnChanges, OnDestroy, OnInit {
}
ngOnInit
()
{
this
.
playVedioUrl
=
this
.
videoUrl
.
replace
(
`_h.mp4`
,
`_l.mp4`
);;
this
.
parentRef
.
emit
(
this
);
}
...
...
@@ -127,12 +126,11 @@ export class UploadVideoComponent implements OnChanges, OnDestroy, OnInit {
md5Short
(
str
,
_salt
)
{
return
cryptoJs
.
MD5
(
str
+
_salt
).
toString
();
}
ngOnChanges
()
{
// if (!this.videoFile || this.showUploadBtn) {
// return;
// }
// this.beforeUpload(this.videoFile);
// this.handleUpload();
ngOnChanges
(
changes
:
SimpleChanges
)
{
console
.
log
(
`=============changes==============`
,
changes
);
if
(
changes
[
'
videoUrl
'
]
&&
!
this
.
uploaded
)
{
this
.
playVedioUrl
=
this
.
videoUrl
?
this
.
videoUrl
.
replace
(
`_h.mp4`
,
`_l.mp4`
)
:
''
;
}
}
ngOnDestroy
():
void
{
URL
.
revokeObjectURL
(
this
.
videoUrl
);
...
...
@@ -281,7 +279,7 @@ export class UploadVideoComponent implements OnChanges, OnDestroy, OnInit {
}
uploadSuccess
=
(
file
)
=>
{
this
.
nzMessageService
.
info
(
'
Upload Success
'
);
//
this.nzMessageService.info('Upload Success');
// this.updateStatus(false);
this
.
uploading
=
false
;
this
.
uploaded
=
true
;
...
...
src/app/form/form.component.html
View file @
165c7f5f
...
...
@@ -113,7 +113,7 @@
<div
style=
"margin-bottom: 10px; display: flex; align-items: center;"
>
<div
style=
"width: 300px;"
>
<app-upload-image-with-preview
[
picUrl
]="
question
.
pic_url
"
<app-upload-image-with-preview
[
picUrl
]="
question
.
pic_url
"
[
TIP
]="'点击上传题目图片'"
(
imageUploaded
)="
onItemImgUploadSuccess
($
event
,
question
,
'
pic_url
')"
>
</app-upload-image-with-preview>
</div>
...
...
src/app/form/form.component.ts
View file @
165c7f5f
...
...
@@ -759,10 +759,11 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
initItem
()
{
if
(
this
.
item
.
video_url
)
{
this
.
fragmentVideoUrl
=
this
.
item
.
video_url
.
replace
(
"
_h.mp4
"
,
"
.mp4
"
).
replace
(
"
.mp4
"
,
"
_l.mp4
"
);
}
}
templateTypeChange
(
e
)
{
console
.
log
(
"
in templateTypeChange e:
"
,
e
);
...
...
@@ -772,9 +773,6 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
createShell
()
{
this
.
item
.
wordList
.
push
({
word
:
''
,
...
...
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