Skip to content

Commit

Permalink
fix(player): add timeout to trick webkit's player
Browse files Browse the repository at this point in the history
  • Loading branch information
mbaraa committed Jul 2, 2024
1 parent 2b9d4b3 commit 7bcd114
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/static/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -615,13 +615,13 @@ async function playSong(song) {

await downloadSong(song.yt_id).then(() => {
stopMuzikk();
// 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);
setTimeout(75);
audioPlayerEl.load();
});

Expand Down

0 comments on commit 7bcd114

Please sign in to comment.