bugfix: when first track tapped immediately after opening, play it

Hunter
Monday, April 27th, 2026 at 3:33 PM

resources/script.js+5 

resources/script.js
339  function toggleLooping(index) {
340  	if (!playerReady) return;
341  	if (index === currentTrackIndex) {
342 +		// First-tap on the auto-selected track: nothing is loaded yet, so start it like any other track.
343 +		if (!audio.src) {
344 +			playTrack(index);
345 +			return;
346 +		}
347  		if (!isPlaying && currentTrackDisplay.textContent.includes('Ready to play')) {
348  			audio.play().catch(err => {
349  				console.error('Failed to play audio:', err);