完善视频上传

This commit is contained in:
none
2023-03-08 15:56:06 +08:00
parent b12fb1d7a9
commit 9428cf1785
7 changed files with 56 additions and 47 deletions

View File

@@ -65,14 +65,9 @@ export function parseVideo(file: File): Promise<VideoParseInfo> {
}
ctx.drawImage(video, 0, 0, width, height); //绘制canvas
let dataURL = canvas.toDataURL("image/png"); //转换为base64
const imageFile = transformBase64ToBlob(
dataURL,
"image/png",
file.name + ".png"
);
video.remove();
let info: VideoParseInfo = {
poster: imageFile,
poster: dataURL,
duration: parseInt(video.duration + ""),
};
return resolve(info);