Commit 0ec429d
committed
fix(studio): single-frame export uses wrong content, ignores duration setting
1. Wrong content: exportMp4 always rendered the template's original
source HTML, ignoring the agent-generated preview saved to
lastPreviewHtmlPath. Now uses lastPreviewHtmlPath when present.
2. Duration ignored: exportMp4 hardcoded `duration: 'auto'`, causing
the adapter to fall back to the animation's natural length (~4s)
instead of the user's setting. durationTargetSec was defined in
UserPreferences but never written or read.
- studio-server now persists collected.duration to
preferences.durationTargetSec at generate time (covers both
single-frame and multi-frame paths).
- exportMp4 reads durationTargetSec and passes it as
durationMode: 'explicit' so the adapter honors it as a hard cap.
3. UI showed render time not video duration: the "MP4 已导出 · Xs"
badge was displaying elapsed_ms (wall-clock render time) instead
of the actual video length. export_done SSE event now carries
duration_sec; the studio UI uses that instead.1 parent 90a036a commit 0ec429d
3 files changed
Lines changed: 27 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | | - | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
402 | 406 | | |
403 | 407 | | |
404 | 408 | | |
| |||
958 | 962 | | |
959 | 963 | | |
960 | 964 | | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
961 | 975 | | |
962 | 976 | | |
963 | 977 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
446 | 454 | | |
447 | 455 | | |
448 | | - | |
| 456 | + | |
449 | 457 | | |
450 | 458 | | |
451 | 459 | | |
452 | 460 | | |
453 | 461 | | |
454 | | - | |
| 462 | + | |
| 463 | + | |
455 | 464 | | |
456 | 465 | | |
457 | 466 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| |||
0 commit comments