Skip to content

Create polished demo videos without editing skills. Mac/Windows/Linux

fix: address CodeRabbit review — fallback, i18n, return type cleanup

webadderallaf72e8fdbf9d
diff --git a/src/components/video-editor/VideoEditor.tsx b/src/components/video-editor/VideoEditor.tsx
index 9c99b88d..42debcad 100644
--- a/src/components/video-editor/VideoEditor.tsx
+++ b/src/components/video-editor/VideoEditor.tsx
@@ -4234,7 +4234,7 @@ export default function VideoEditor() {
})
: isExportFinalizing
? t("editor.exportStatus.finalizingPercent", "Finalizing {{percent}}%", {
- percent: Math.round(exportFinalizingProgress ?? 99),
+ percent: Math.round(exportFinalizingProgress ?? 100),
})
: t("editor.exportStatus.completePercent", "{{percent}}% complete", {
percent: Math.round(exportProgress.percentage),
diff --git a/src/i18n/locales/en/editor.json b/src/i18n/locales/en/editor.json
index 38159315..cf070cde 100644
--- a/src/i18n/locales/en/editor.json
+++ b/src/i18n/locales/en/editor.json
@@ -122,6 +122,9 @@
"complete": "Export complete",
"savedSuccessfully": "Your file was saved successfully."
},
+ "export": {
+ "processingAudioEdits": "Processing audio with speed/overlay edits"
+ },
"toolbar": {
"addLayer": "Add Layer",
"splitClip": "Split Clip (C)"
diff --git a/src/i18n/locales/es/editor.json b/src/i18n/locales/es/editor.json
index 3f0441ec..a42ea123 100644
--- a/src/i18n/locales/es/editor.json
+++ b/src/i18n/locales/es/editor.json
@@ -122,6 +122,9 @@
"complete": "Exportación completada",
"savedSuccessfully": "Tu archivo se guardó correctamente."
},
+ "export": {
+ "processingAudioEdits": "Procesando audio con ediciones de velocidad/superposición"
+ },
"toolbar": {
"addLayer": "Agregar capa",
"splitClip": "Dividir clip (C)"
diff --git a/src/i18n/locales/ko/editor.json b/src/i18n/locales/ko/editor.json
index a364237c..56eb6bc5 100644
--- a/src/i18n/locales/ko/editor.json
+++ b/src/i18n/locales/ko/editor.json
@@ -123,6 +123,9 @@
"complete": "내보내기 완료",
"savedSuccessfully": "파일이 성공적으로 저장되었습니다."
},
+ "export": {
+ "processingAudioEdits": "속도/오버레이 편집으로 오디오 처리 중"
+ },
"toolbar": {
"addLayer": "레이어 추가",
"splitClip": "클립 분할 (C)"
diff --git a/src/i18n/locales/nl/editor.json b/src/i18n/locales/nl/editor.json
index d4b00f8d..b174ca98 100644
--- a/src/i18n/locales/nl/editor.json
+++ b/src/i18n/locales/nl/editor.json
@@ -123,6 +123,9 @@
"complete": "Export voltooid",
"savedSuccessfully": "Je bestand is succesvol opgeslagen."
},
+ "export": {
+ "processingAudioEdits": "Audio verwerken met snelheids-/overlay-bewerkingen"
+ },
"toolbar": {
"addLayer": "Laag toevoegen",
"splitClip": "Clip splitsen (C)"
diff --git a/src/i18n/locales/zh-CN/editor.json b/src/i18n/locales/zh-CN/editor.json
index a4dec228..4a0c4a5d 100644
--- a/src/i18n/locales/zh-CN/editor.json
+++ b/src/i18n/locales/zh-CN/editor.json
@@ -122,6 +122,9 @@
"complete": "导出完成",
"savedSuccessfully": "文件已成功保存。"
},
+ "export": {
+ "processingAudioEdits": "正在处理带有速度/叠加编辑的音频"
+ },
"toolbar": {
"addLayer": "添加图层",
"splitClip": "拆分片段 (C)"
diff --git a/src/lib/exporter/audioEncoder.ts b/src/lib/exporter/audioEncoder.ts
index 31bf5553..e271c541 100644
--- a/src/lib/exporter/audioEncoder.ts
+++ b/src/lib/exporter/audioEncoder.ts
@@ -611,9 +611,7 @@ export class AudioProcessor {
// Extend for audio regions that might exceed the video timeline
for (const { region } of regionEntries) {
const regionEndOutput = this.sourceTimeToOutputTime(region.endMs, slices);
- if (regionEndOutput !== null) {
- outputDurationMs = Math.max(outputDurationMs, regionEndOutput);
- }
+ outputDurationMs = Math.max(outputDurationMs, regionEndOutput);
}
const numChannels = Math.min(primaryBuffer?.numberOfChannels ?? 2, 2);
@@ -744,7 +742,7 @@ export class AudioProcessor {
chunkIndex: number,
) => Promise<void>,
): Promise<void> {
- const { slices, outputDurationMs, numChannels } = prepared;
+ const { slices, numChannels } = prepared;
let outputOffsetSec = 0;
const chunkCount = Math.ceil(totalOutputSec / OFFLINE_CHUNK_DURATION_SEC);
@@ -792,7 +790,6 @@ export class AudioProcessor {
buffer,
region,
slices,
- outputDurationMs,
outputOffsetSec,
chunkSec,
);
@@ -814,13 +811,11 @@ export class AudioProcessor {
buffer: AudioBuffer,
region: AudioRegion,
slices: TimelineSlice[],
- totalOutputDurationMs: number,
chunkOutputStartSec: number,
chunkDurationSec: number,
): void {
- const outputStartMs = this.sourceTimeToOutputTime(region.startMs, slices) ?? 0;
- const outputEndMs =
- this.sourceTimeToOutputTime(region.endMs, slices) ?? totalOutputDurationMs;
+ const outputStartMs = this.sourceTimeToOutputTime(region.startMs, slices);
+ const outputEndMs = this.sourceTimeToOutputTime(region.endMs, slices);
let localStartSec = outputStartMs / 1000 - chunkOutputStartSec;
let localEndSec = outputEndMs / 1000 - chunkOutputStartSec;
@@ -1240,7 +1235,7 @@ export class AudioProcessor {
private sourceTimeToOutputTime(
sourceMs: number,
slices: TimelineSlice[],
- ): number | null {
+ ): number {
let outputMs = 0;
for (const slice of slices) {