Commit 2a2fc7b2 authored by liujiangnan's avatar liujiangnan

debug

parent 2196ffd6
...@@ -76,11 +76,6 @@ function initVueApp(savedData) { ...@@ -76,11 +76,6 @@ function initVueApp(savedData) {
// 如果有保存的数据,恢复状态 // 如果有保存的数据,恢复状态
if (savedData && savedData.videoUrl) { if (savedData && savedData.videoUrl) {
this.videoUrl = savedData.videoUrl.replace('http://', 'https://'); this.videoUrl = savedData.videoUrl.replace('http://', 'https://');
if (this.videoUrl) {
this.deepCheckUtilHave(this.videoUrl.replace('.mp4', '_mini.mp4')).then(res => {
this.videoUrl = this.videoUrl.replace('.mp4', '_mini.mp4');
});
}
} }
// 如果存在未完成的任务,恢复轮询 // 如果存在未完成的任务,恢复轮询
if (savedData && savedData.task_uuid) { if (savedData && savedData.task_uuid) {
...@@ -405,17 +400,6 @@ function initVueApp(savedData) { ...@@ -405,17 +400,6 @@ function initVueApp(savedData) {
secure: true, secure: true,
silent: true silent: true
}); });
const videoClient = new OSS({
region: ossConfig.region,
accessKeyId: ossConfig.accessKeyId,
accessKeySecret: ossConfig.accessKeySecret,
stsToken: ossConfig.securityToken,
bucket: 'iplayabc-worker-queue-video-mini',
cors: true,
secure: true,
silent: true
});
// 计算文件MD5作为新文件名 // 计算文件MD5作为新文件名
this.$message.info('正在计算文件 MD5 值...'); this.$message.info('正在计算文件 MD5 值...');
let md5 = await this.calculateMD5(file); let md5 = await this.calculateMD5(file);
...@@ -428,9 +412,6 @@ function initVueApp(savedData) { ...@@ -428,9 +412,6 @@ function initVueApp(savedData) {
try { try {
// 使用 getObjectMeta 代替 head,并添加 silent 参数 // 使用 getObjectMeta 代替 head,并添加 silent 参数
await client.getObjectMeta(newFileName, { silent: true }); await client.getObjectMeta(newFileName, { silent: true });
if (ext == 'mp4') {
await videoClient.getObjectMeta(newFileName.replace('.mp4', '_mini.mp4'), { silent: true });
}
isExist = true; isExist = true;
} catch (error) { } catch (error) {
if (error.code !== 'NoSuchKey') { if (error.code !== 'NoSuchKey') {
...@@ -447,15 +428,6 @@ function initVueApp(savedData) { ...@@ -447,15 +428,6 @@ function initVueApp(savedData) {
this.uploadProgress = progress; this.uploadProgress = progress;
} }
}); });
if (ext == 'mp4') {
newFileName = `${md5}_mini.mp4`;
await videoClient.multipartUpload(newFileName, file, {
progress: (p) => {
const progress = Math.floor(p * 50) + 50;
this.uploadProgress = progress;
}
});
}
} }
return `${ossConfig.domain.replace('http://', 'https://')}${newFileName}`; return `${ossConfig.domain.replace('http://', 'https://')}${newFileName}`;
// } catch (error) { // } catch (error) {
...@@ -481,7 +453,7 @@ function initVueApp(savedData) { ...@@ -481,7 +453,7 @@ function initVueApp(savedData) {
const res = await this.uploadToOSS(file, ossConfig); const res = await this.uploadToOSS(file, ossConfig);
this.uploading = false; this.uploading = false;
this.uploadProgress = 100; this.uploadProgress = 100;
await this.deepCheckUtilHave(res); // await this.deepCheckUtilHave(res);
this.videoUrl = res; this.videoUrl = res;
this.$message.success('视频上传成功!'); this.$message.success('视频上传成功!');
...@@ -534,7 +506,7 @@ function initVueApp(savedData) { ...@@ -534,7 +506,7 @@ function initVueApp(savedData) {
// 生成字幕 // 生成字幕
async generateSubtitles() { async generateSubtitles() {
const videoUrl = (this.videoUrl || '').replace('_mini.mp4', '.mp4'); const videoUrl = (this.videoUrl || '');
if (!videoUrl) { if (!videoUrl) {
this.$message.warning('请先上传或选择视频'); this.$message.warning('请先上传或选择视频');
return; return;
...@@ -589,7 +561,7 @@ function initVueApp(savedData) { ...@@ -589,7 +561,7 @@ function initVueApp(savedData) {
// 去人声 // 去人声
async removeVocals() { async removeVocals() {
const videoUrl = (this.videoUrl || '').replace('_mini.mp4', '.mp4'); const videoUrl = (this.videoUrl || '');
if (!videoUrl) { if (!videoUrl) {
this.$message.warning('请先上传或选择视频'); this.$message.warning('请先上传或选择视频');
return; return;
...@@ -643,7 +615,7 @@ function initVueApp(savedData) { ...@@ -643,7 +615,7 @@ function initVueApp(savedData) {
// 数据持久化 // 数据持久化
saveData() { saveData() {
const data = { const data = {
videoUrl: this.videoUrl ? this.videoUrl.replace('_mini.mp4', '.mp4') : '', videoUrl: this.videoUrl ? this.videoUrl : '',
playbackRate: this.playbackRate, playbackRate: this.playbackRate,
}; };
if (this.task_uuid) { if (this.task_uuid) {
......
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