Skip to content

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

fix: add name display for audio files

4rjuncf2539788ace7
diff --git a/src/components/video-editor/timeline/Item.tsx b/src/components/video-editor/timeline/Item.tsx
index 1f9d3eb8..b68f2127 100644
--- a/src/components/video-editor/timeline/Item.tsx
+++ b/src/components/video-editor/timeline/Item.tsx
@@ -148,7 +148,7 @@ export default function Item({
) : isAudio ? (
<>
<Music className="w-3.5 h-3.5 shrink-0" />
- <span className="text-[11px] font-semibold tracking-tight whitespace-nowrap">
+ <span className="text-[11px] font-semibold tracking-tight truncate max-w-full">
{children}
</span>
</>
diff --git a/src/components/video-editor/timeline/TimelineEditor.tsx b/src/components/video-editor/timeline/TimelineEditor.tsx
index 4dfceaf0..66a397e6 100644
--- a/src/components/video-editor/timeline/TimelineEditor.tsx
+++ b/src/components/video-editor/timeline/TimelineEditor.tsx
@@ -1245,13 +1245,16 @@ export default function TimelineEditor({
variant: 'speed',
}));
- const audios: TimelineRenderItem[] = audioRegions.map((region, index) => ({
- id: region.id,
- rowId: AUDIO_ROW_ID,
- span: { start: region.startMs, end: region.endMs },
- label: `Audio ${index + 1}`,
- variant: 'audio',
- }));
+ const audios: TimelineRenderItem[] = audioRegions.map((region) => {
+ const fileName = region.audioPath.split(/[\\/]/).pop()?.replace(/\.[^.]+$/, '') || 'Audio';
+ return {
+ id: region.id,
+ rowId: AUDIO_ROW_ID,
+ span: { start: region.startMs, end: region.endMs },
+ label: fileName,
+ variant: 'audio',
+ };
+ });
return [...zooms, ...trims, ...annotations, ...speeds, ...audios];
}, [zoomRegions, trimRegions, annotationRegions, speedRegions, audioRegions]);