fix: support video durations from 5 to 14 seconds
This commit is contained in:
@@ -456,6 +456,8 @@ function switchModule(module) {
|
||||
}
|
||||
|
||||
function createShot(seed = {}, index = state.shots.length) {
|
||||
const seedDuration = Number(seed.duration);
|
||||
const duration = Number.isFinite(seedDuration) ? Math.min(14, Math.max(5, Math.round(seedDuration))) : 5;
|
||||
return {
|
||||
id: seed.id || `shot-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`,
|
||||
title: seed.title || (index === 0 ? "电梯口对话" : `片段 ${String(index + 1).padStart(2, "0")}`),
|
||||
@@ -466,7 +468,7 @@ function createShot(seed = {}, index = state.shots.length) {
|
||||
roleIds: Array.isArray(seed.roleIds) ? [...seed.roleIds] : state.roles.map((role) => role.id),
|
||||
model: seed.model || "doubao-seedance-2-0-260128",
|
||||
ratio: seed.ratio || "9:16",
|
||||
duration: Number(seed.duration) || 5,
|
||||
duration,
|
||||
resolution: seed.resolution || "720p",
|
||||
generateAudio: seed.generateAudio !== false,
|
||||
watermark: Boolean(seed.watermark),
|
||||
|
||||
@@ -204,9 +204,15 @@
|
||||
<span>时长</span>
|
||||
<select id="duration">
|
||||
<option value="5">5 秒</option>
|
||||
<option value="6">6 秒</option>
|
||||
<option value="7">7 秒</option>
|
||||
<option value="8">8 秒</option>
|
||||
<option value="9">9 秒</option>
|
||||
<option value="10">10 秒</option>
|
||||
<option value="15">15 秒</option>
|
||||
<option value="11">11 秒</option>
|
||||
<option value="12">12 秒</option>
|
||||
<option value="13">13 秒</option>
|
||||
<option value="14">14 秒</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="field">
|
||||
@@ -283,6 +289,6 @@
|
||||
</div>
|
||||
|
||||
<div class="toast hidden" id="toast"></div>
|
||||
<script src="./app.js?v=29"></script>
|
||||
<script src="./app.js?v=30"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user