diff --git a/public/playlist.js b/public/playlist.js index 444530e..b2338af 100644 --- a/public/playlist.js +++ b/public/playlist.js @@ -666,7 +666,7 @@ var plTimeReadout = document.getElementById('plTimeReadout') var plTrimDuration = document.getElementById('plTrimDuration') var plStartSec = document.getElementById('plStartSec') - var plEndSec = document.getElementById('plEndSec') + var plLengthSec = document.getElementById('plLengthSec') var MIN_SEL = 0.05 var trimPlayer = null @@ -698,7 +698,8 @@ plTrimHandleEnd.style.left = endPct + '%' plTrimDuration.textContent = '선택: ' + (end - tctx.start).toFixed(1) + '초' plStartSec.value = (tctx.start || 0).toFixed(2) - plEndSec.value = tctx.end == null ? '' : tctx.end.toFixed(2) + // 끝 대신 재생 길이(초)를 보여준다 (끝까지면 영상 끝 - 시작). + plLengthSec.value = Math.max(0, end - tctx.start).toFixed(2) } function renderPlayhead() { if (!tctx) return @@ -868,15 +869,13 @@ tctx.start = tctx.duration ? clampNum(v, 0, tEnd() - MIN_SEL) : v renderTrimBar() }) - plEndSec.addEventListener('change', function () { + plLengthSec.addEventListener('change', function () { if (!tctx) return - if (plEndSec.value === '') { - tctx.end = null - } else { - var v = Number(plEndSec.value) - if (!isFinite(v) || v <= tctx.start) { renderTrimBar(); return } - tctx.end = tctx.duration ? clampNum(v, tctx.start + MIN_SEL, tctx.duration) : v - } + // 길이(초) 입력 → 끝 = 시작 + 길이. + var v = Number(plLengthSec.value) + if (!isFinite(v) || v <= 0) { renderTrimBar(); return } + var end = tctx.start + v + tctx.end = tctx.duration ? clampNum(end, tctx.start + MIN_SEL, tctx.duration) : end renderTrimBar() }) diff --git a/views/op/playlist.ejs b/views/op/playlist.ejs index 65178cf..aabb510 100644 --- a/views/op/playlist.ejs +++ b/views/op/playlist.ejs @@ -99,7 +99,7 @@
선택: 0.0초 - +

재생바의 파란 핸들을 끌어 구간을 정합니다. 적용하면 항목의 시작/길이가 갱신되고, 다운로드 완료 후 이 구간으로 잘립니다.