Commit 2a2fc7b2 authored by liujiangnan's avatar liujiangnan

debug

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