Skip to content

Commit

Permalink
Show time on start
Browse files Browse the repository at this point in the history
  • Loading branch information
SH20RAJ authored Mar 17, 2024
1 parent 6b9def5 commit c3793b4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions audiplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ ap_audioElements.forEach((audioElement, index) => {
downloadButton.style.display = 'none';
}
}
showtime(audioElement, index);
});


Expand Down Expand Up @@ -227,6 +228,7 @@ function showtime(audioElement, index) {
const duration_minutes = Math.floor(duration / 60);
const duration_seconds = Math.floor(duration - duration_minutes * 60);
let time = minutes + ":" + (seconds < 10 ? "0" + seconds : seconds) + " / " + duration_minutes + ":" + (duration_seconds < 10 ? "0" + duration_seconds : duration_seconds);

document.querySelector(`.ap_container_${index} .ap_time`).innerHTML = time;
}

Expand Down

0 comments on commit c3793b4

Please sign in to comment.