Skip to content

Commit b22762f

Browse files
authored
This has been this most annoying bug in the last 10 months................. (#98)
* simsalabim * bumpyyyy
1 parent 882e79c commit b22762f

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

MyMusicClientSveltePwa/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mymusicclientsveltepwa",
33
"private": true,
4-
"version": "0.1.12",
4+
"version": "0.1.121",
55
"type": "module",
66
"scripts": {
77
"dev": "vite --host",

MyMusicClientSveltePwa/src/lib/scripts/playbackService.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,17 @@ export function initializePlaybackService() {
109109

110110
audioElement.addEventListener("error", (e) => {
111111
console.error("Error loading audio:", e);
112+
// Retry
113+
audioElement.load();
114+
isLoading.set(true);
112115
});
116+
117+
audioElement.addEventListener("abort", (e) => {
118+
console.error("Abort loading audio:", e);
119+
// Retry
120+
audioElement.load();
121+
isLoading.set(true);
122+
})
113123
}
114124

115125
export function nextSong() {
@@ -143,10 +153,10 @@ export function playOrPauseSong(songId) {
143153
songIndex = playlistSongs.findIndex((song) => song.id === songId);
144154
audioElement.src = getPlaybackUrl(song.source_id);
145155
audioElement.load();
156+
isLoading.set(true);
146157
currentSong.set(playlistSongs.find((song) => song.id === songId));
147158
isPlaying.set(false); // set to false since this is a new song
148159
setCurrentSongIndex(songIndex);
149-
isLoading.set(true);
150160
}
151161
else if (get(isPlaying)) {
152162
audioElement.pause();

0 commit comments

Comments
 (0)