Skip to content

Commit

Permalink
fix(player): check if song is playing before stopping
Browse files Browse the repository at this point in the history
  • Loading branch information
mbaraa committed Jul 2, 2024
1 parent 7bcd114 commit a5f1709
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/static/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,10 @@ function playPauser(audioEl) {
*/
function stopper(audioEl) {
return () => {
audioEl.pause();
audioEl.currentTime = 0;
if (!audioEl.paused) {
audioEl.pause();
audioEl.currentTime = 0;
}
const songEl = document.getElementById(
"song-" + playerState.playlist.songs[playerState.currentSongIdx].yt_id,
);
Expand Down

0 comments on commit a5f1709

Please sign in to comment.