File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff 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
115125export 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 ( ) ;
You can’t perform that action at this time.
0 commit comments