修复问题
This commit is contained in:
@@ -439,6 +439,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
const status = progress.status;
|
const status = progress.status;
|
||||||
|
|
||||||
if (status === 'downloading') {
|
if (status === 'downloading') {
|
||||||
|
if (transcodingOverlay) transcodingOverlay.classList.remove('hidden');
|
||||||
|
if (videoPlayer) videoPlayer.classList.add('hidden');
|
||||||
hasDownloadCompleted = false;
|
hasDownloadCompleted = false;
|
||||||
showDownloadPhase();
|
showDownloadPhase();
|
||||||
const percent = Math.min(Math.max(Math.round(progress.percent || 0), 0), 100);
|
const percent = Math.min(Math.max(Math.round(progress.percent || 0), 0), 100);
|
||||||
@@ -449,6 +451,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
downloadProgressText.textContent = `${percent}%`;
|
downloadProgressText.textContent = `${percent}%`;
|
||||||
downloadProgressFill.style.width = `${percent}%`;
|
downloadProgressFill.style.width = `${percent}%`;
|
||||||
} else if (status === 'downloaded') {
|
} else if (status === 'downloaded') {
|
||||||
|
if (transcodingOverlay) transcodingOverlay.classList.remove('hidden');
|
||||||
|
if (videoPlayer) videoPlayer.classList.add('hidden');
|
||||||
hasDownloadCompleted = true;
|
hasDownloadCompleted = true;
|
||||||
showDownloadPhase();
|
showDownloadPhase();
|
||||||
updateTranscodeProgressBar(100);
|
updateTranscodeProgressBar(100);
|
||||||
@@ -461,6 +465,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
showTranscodePhase();
|
showTranscodePhase();
|
||||||
}, 600);
|
}, 600);
|
||||||
} else if (status === 'transcoding') {
|
} else if (status === 'transcoding') {
|
||||||
|
if (transcodingOverlay) transcodingOverlay.classList.remove('hidden');
|
||||||
|
if (videoPlayer) videoPlayer.classList.add('hidden');
|
||||||
hasDownloadCompleted = true;
|
hasDownloadCompleted = true;
|
||||||
showTranscodePhase();
|
showTranscodePhase();
|
||||||
const percent = Math.min(Math.max(Math.round(progress.percent || 0), 0), 100);
|
const percent = Math.min(Math.max(Math.round(progress.percent || 0), 0), 100);
|
||||||
@@ -476,6 +482,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
statTime.textContent = progress.timemark ? `${progress.timemark}` : '';
|
statTime.textContent = progress.timemark ? `${progress.timemark}` : '';
|
||||||
}
|
}
|
||||||
} else if (status === 'finished') {
|
} else if (status === 'finished') {
|
||||||
|
if (transcodingOverlay) transcodingOverlay.classList.remove('hidden');
|
||||||
hasDownloadCompleted = true;
|
hasDownloadCompleted = true;
|
||||||
showTranscodePhase();
|
showTranscodePhase();
|
||||||
updateTranscodeProgressBar(100);
|
updateTranscodeProgressBar(100);
|
||||||
@@ -483,10 +490,12 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
transcodeProgressFill.style.width = '100%';
|
transcodeProgressFill.style.width = '100%';
|
||||||
transcodeDetailText.textContent = '转码完成';
|
transcodeDetailText.textContent = '转码完成';
|
||||||
} else if (status === 'failed') {
|
} else if (status === 'failed') {
|
||||||
|
if (transcodingOverlay) transcodingOverlay.classList.remove('hidden');
|
||||||
updateTranscodeProgressBar(progress.percent || 0);
|
updateTranscodeProgressBar(progress.percent || 0);
|
||||||
transcodeDetailText.textContent = `失败: ${progress.details || '未知错误'}`;
|
transcodeDetailText.textContent = `失败: ${progress.details || '未知错误'}`;
|
||||||
transcodeProgressFill.style.background = 'linear-gradient(90deg, #dc2626, #b91c1c)';
|
transcodeProgressFill.style.background = 'linear-gradient(90deg, #dc2626, #b91c1c)';
|
||||||
} else if (status === 'cancelled') {
|
} else if (status === 'cancelled') {
|
||||||
|
if (transcodingOverlay) transcodingOverlay.classList.remove('hidden');
|
||||||
updateTranscodeProgressBar(0);
|
updateTranscodeProgressBar(0);
|
||||||
transcodeDetailText.textContent = '已取消';
|
transcodeDetailText.textContent = '已取消';
|
||||||
transcodeProgressFill.style.width = '0%';
|
transcodeProgressFill.style.width = '0%';
|
||||||
@@ -1231,6 +1240,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
}
|
}
|
||||||
stopPolling();
|
stopPolling();
|
||||||
resetPhases();
|
resetPhases();
|
||||||
|
handleProgress({ status: 'downloading', percent: 0, downloadedBytes: 0, totalBytes: 0 });
|
||||||
seekOffset = 0;
|
seekOffset = 0;
|
||||||
videoDuration = 0;
|
videoDuration = 0;
|
||||||
isStreamActive = false;
|
isStreamActive = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user