Commit feec6013 authored by liujiangnan's avatar liujiangnan

feat: 封面

parent ed3dd05c
......@@ -18,28 +18,16 @@
</div>
</div>
</div>
<div nz-col nzSpan="4" class="-col-4" style=" display: flex;
justify-content: center;">
<div nz-col nzSpan="8" class="-col-4" style="display: flex; justify-content: center;">
<app-upload-video
(videoUploaded)="onVideoUploadSuccess($event)"
[item]="item"
[videoUrl]="item.contentObj.video_url"></app-upload-video>
</div>
<div nz-col nzSpan="4" style="text-align: center;">
<button nz-button nzType="primary"
style="margin-bottom: 1rem"
(click)="setVideoCover()">
Set Video Cover
</button>
</div>
</div>
<div class="row" style="margin-top: 1rem"
*ngIf="item.contentObj.video_url">
<div class="col-8">
<img *ngIf="item.contentObj.pic_id"
[src]="item.contentObj.pic_id"
style="width:100%;overflow: hidden;box-shadow: 0 0 20px 0px #444;"/>
style="margin-bottom: 1rem"
(click)="setVideoCover()">
Set Video Cover
</button>
</div>
</div>
......@@ -101,15 +101,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.nzMessageService.error('video error');
}
videoSeeked(evt) {
return
const video = evt.target;
if (video.src && video.src.startsWith('blob:')) {
return;
}
if (!this.item.contentObj.pic_id) {
this.setVideoCover();
this.newVideoCover = false;
}
return;
}
setVideoCover() {
......@@ -134,6 +126,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.http.post(this.uploadUrl, formData).subscribe(
(res: any) => {
(window as any).courseware.sendEvent("screenshot", {"url": res.url}, this.saveKey);
this.item.contentObj.pic_id = res.url;
this.save();
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment