Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MyMusicClientSveltePwa/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mymusicclientsveltepwa",
"private": true,
"version": "0.1.12",
"version": "0.1.121",
"type": "module",
"scripts": {
"dev": "vite --host",
Expand Down
12 changes: 11 additions & 1 deletion MyMusicClientSveltePwa/src/lib/scripts/playbackService.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,17 @@ export function initializePlaybackService() {

audioElement.addEventListener("error", (e) => {
console.error("Error loading audio:", e);
// Retry
audioElement.load();
isLoading.set(true);
});

audioElement.addEventListener("abort", (e) => {
console.error("Abort loading audio:", e);
// Retry
audioElement.load();
isLoading.set(true);
})
}

export function nextSong() {
Expand Down Expand Up @@ -143,10 +153,10 @@ export function playOrPauseSong(songId) {
songIndex = playlistSongs.findIndex((song) => song.id === songId);
audioElement.src = getPlaybackUrl(song.source_id);
audioElement.load();
isLoading.set(true);
currentSong.set(playlistSongs.find((song) => song.id === songId));
isPlaying.set(false); // set to false since this is a new song
setCurrentSongIndex(songIndex);
isLoading.set(true);
}
else if (get(isPlaying)) {
audioElement.pause();
Expand Down
Loading