fix initial page load for track duration

This commit is contained in:
cottongin 2026-01-17 21:13:58 -05:00
parent ffc8f2a558
commit 97a0c15e8e
No known key found for this signature in database
GPG Key ID: 0ECC91FE4655C262

9
app.js
View File

@ -1,4 +1,4 @@
const APP_VERSION = '0.1.0-beta';
const APP_VERSION = '0.1.1-beta';
const playlist = [
{ url: 'https://feed.falsefinish.club/Echo%20Reality/PINK%20FLIGHT/MP3%20BOUNCE/01.%20PINK%20FLIGHT%20ATTENDANT.mp3', name: 'TRACK 1 - PINK FLIGHT ATTENDANT' },
{ url: 'https://feed.falsefinish.club/Echo%20Reality/PINK%20FLIGHT/MP3%20BOUNCE/02.%20NOW.mp3', name: 'TRACK 2 - NOW' },
@ -1146,6 +1146,13 @@ audio.addEventListener('timeupdate', () => {
updateTapeSizes();
});
// Update time display when metadata loads (fixes cold start 0:00 / 0:00 issue)
audio.addEventListener('loadedmetadata', () => {
const current = formatTime(audio.currentTime);
const duration = formatTime(audio.duration);
timeDisplay.textContent = `${current} / ${duration}`;
});
// Format time helper
function formatTime(seconds) {
if (isNaN(seconds)) return '00:00';