Explorar el Código

feat(ui): show total track length on progress bar instead of remaining

Right-hand time on the playback bar now displays the full track length
(e.g. 1:00:00) rather than the countdown (-49:39). Updated the progress-bar
click-to-seek handler to read total directly from that label instead of
deriving it from current + remaining. The canvas remaining-time display
mode is untouched.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
master
Jan Svabenik hace 1 mes
padre
commit
151d977566
Se han modificado 1 ficheros con 4 adiciones y 5 borrados
  1. +4
    -5
      web/static/app.js

+ 4
- 5
web/static/app.js Ver fichero

@@ -181,11 +181,11 @@ function applyStatus(st) {
currentLength = st.length;
progressFill.style.width = (st.position / st.length * 100).toFixed(1) + '%';
timeCurrent.textContent = fmtTime(st.position);
timeLength.textContent = '-' + fmtTime(st.length - st.position);
timeLength.textContent = fmtTime(st.length); // total track length
} else {
progressFill.style.width = '0%';
timeCurrent.textContent = '0:00';
timeLength.textContent = '-0:00';
timeLength.textContent = '0:00';
}

btnPlay.textContent = st.state === 'playing' ? SYM.pause : SYM.play;
@@ -215,9 +215,8 @@ qsa('.btn-seek').forEach(function(btn) {
});

$('progress-bar').addEventListener('click', function(e) {
var current = parseTime(timeCurrent.textContent);
var remaining = parseTime(timeLength.textContent.replace('-', ''));
var total = current + remaining;
var current = parseTime(timeCurrent.textContent);
var total = parseTime(timeLength.textContent); // right value is now total length
if (!total) return;
var rect = e.currentTarget.getBoundingClientRect();
var target = Math.round((e.clientX - rect.left) / rect.width * total);


Cargando…
Cancelar
Guardar