Commit 165c7f5f authored by kingweight's avatar kingweight

修复视频上传问题

parent e153ebda
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;
......
......@@ -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>
......
......@@ -758,12 +758,13 @@ 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);
this.item.templateType = e;
......@@ -772,9 +773,6 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
createShell() {
this.item.wordList.push({
word: '',
......
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