diff options
| author | Maze Winther <mazewinther@gmail.com> | 2026-04-07 15:51:53 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2026-04-13 05:01:51 +0200 |
| commit | f06a930fc1920b7eb396202d429c237ff30c6b5e (patch) | |
| tree | acc2aceac282570d02a04b601ea303fc832d5f79 /apps/web/src/components/editor | |
| parent | 532f050a647d8d667b8cc2c13b816736c1bf9ec6 (diff) | |
| download | opencut-f06a930fc1920b7eb396202d429c237ff30c6b5e.tar.gz | |
fix: convert media asset duration to ticks on insert
Diffstat (limited to 'apps/web/src/components/editor')
| -rw-r--r-- | apps/web/src/components/editor/panels/assets/views/assets.tsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/web/src/components/editor/panels/assets/views/assets.tsx b/apps/web/src/components/editor/panels/assets/views/assets.tsx index 85888dce..33b47c67 100644 --- a/apps/web/src/components/editor/panels/assets/views/assets.tsx +++ b/apps/web/src/components/editor/panels/assets/views/assets.tsx @@ -26,6 +26,7 @@ import { TooltipTrigger, } from "@/components/ui/tooltip"; import { DEFAULT_NEW_ELEMENT_DURATION } from "@/lib/timeline/creation"; +import { TICKS_PER_SECOND } from "@/lib/wasm"; import { useEditor } from "@/hooks/use-editor"; import { useFileUpload } from "@/hooks/use-file-upload"; import { invokeAction } from "@/lib/actions"; @@ -257,7 +258,9 @@ function MediaAssetDraggable({ startTime: number; }) => { const duration = - asset.duration ?? DEFAULT_NEW_ELEMENT_DURATION; + asset.duration != null + ? Math.round(asset.duration * TICKS_PER_SECOND) + : DEFAULT_NEW_ELEMENT_DURATION; const element = buildElementFromMedia({ mediaId: asset.id, mediaType: asset.type, |
