diff --git a/app/static/js/player.js b/app/static/js/player.js index 1b550e74..fc557abb 100644 --- a/app/static/js/player.js +++ b/app/static/js/player.js @@ -615,8 +615,13 @@ async function playSong(song) { await downloadSong(song.yt_id).then(() => { stopMuzikk(); - audioPlayerEl.children.item(0).src = - `${location.protocol}//${location.host}/muzikkx/${song.yt_id}.mp3`; + // audioPlayerEl.children.item(0).src = + if (audioPlayerEl.childNodes.length > 0) { + audioPlayerEl.removeChild(audioPlayerEl.childNodes.item(0)); + } + const src = document.createElement("source"); + src.src = `${location.protocol}//${location.host}/muzikkx/${song.yt_id}.mp3`; + audioPlayerEl.appendChild(src); audioPlayerEl.load(); }); diff --git a/app/views/components/player/player.templ b/app/views/components/player/player.templ index b3b681ee..cf4c0d16 100644 --- a/app/views/components/player/player.templ +++ b/app/views/components/player/player.templ @@ -36,9 +36,7 @@ templ PlayerSticky() { id="audio-player" controls preload="none" - > - - + > ///