我想从服务器加载的视频文件中获取图像,因为我在组件中使用了ngx-image-uploader标记。
我在我的课程 video.component.ts 中使用此功能:
openEditContentLayout(content: any, itemContent: any) {
console.log(itemContent.file)//it prints in my console like this : http://ipServer:port/myVideo.mp4
this.selectedSection = itemContent;
this.uploadedImageUrl = null;
console.log(this.selectedSection);
this.layoutFormContainer.patchValue({
title: itemContent.title,
content: itemContent.content,
file: itemContent.file //in this level that I wish get an image from my video
});
this.modalService.open(content, { size: 'lg' }).result.then(() => {
this.selectedSection.title = this.layoutFormContainer.get('title').value;
this.selectedSection.content = this.layoutFormContainer.get('content').value;
this.selectedSection.image = this.uploadedImageUrl ?
this.uploadedImageUrl : this.layoutFormContainer.get('image').value;
}, () => {
});
}
这是 video.component.html
<ngx-image-uploader [options]="options" name="imageLayout" (upload)="onUpload($event)" formControlName="file"></ngx-image-uploader>