               
                // End event
                audioElement.addEventListener('ended', () => {
                    clearInterval(updateInterval);
                    positionIndicator.style.opacity = '0';
                });
                
                // Add loadedmetadata event to update progress bar immediately when metadata is available
                audioElement.addEventListener('loadedmetadata', () => {
                    updateProgress();
                });
                
    